/*! For license information please see LICENSES */
(window.webpackJsonp = window.webpackJsonp || []).push([[4], Array(383).concat([function(t, e, r) {
    "use strict";
    var n = r(393)
      , o = r(421)
      , c = r(404)
      , l = r(422)
      , f = r(423);
    (t.exports = function(t, e) {
        var r, o, h, d, desc;
        return arguments.length < 2 || "string" != typeof t ? (d = e,
        e = t,
        t = null) : d = arguments[2],
        n(t) ? (r = f.call(t, "c"),
        o = f.call(t, "e"),
        h = f.call(t, "w")) : (r = h = !0,
        o = !1),
        desc = {
            value: e,
            configurable: r,
            enumerable: o,
            writable: h
        },
        d ? c(l(d), desc) : desc
    }
    ).gs = function(t, e, r) {
        var h, d, y, desc;
        return "string" != typeof t ? (y = r,
        r = e,
        e = t,
        t = null) : y = arguments[3],
        n(e) ? o(e) ? n(r) ? o(r) || (y = r,
        r = void 0) : r = void 0 : (y = e,
        e = r = void 0) : e = void 0,
        n(t) ? (h = f.call(t, "c"),
        d = f.call(t, "e")) : (h = !0,
        d = !1),
        desc = {
            get: e,
            set: r,
            configurable: h,
            enumerable: d
        },
        y ? c(l(y), desc) : desc
    }
}
, function(t, e) {
    "function" == typeof Object.create ? t.exports = function(t, e) {
        e && (t.super_ = e,
        t.prototype = Object.create(e.prototype, {
            constructor: {
                value: t,
                enumerable: !1,
                writable: !0,
                configurable: !0
            }
        }))
    }
    : t.exports = function(t, e) {
        if (e) {
            t.super_ = e;
            var r = function() {};
            r.prototype = e.prototype,
            t.prototype = new r,
            t.prototype.constructor = t
        }
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(392);
    t.exports = function(t) {
        if (!n(t))
            throw new TypeError("Cannot use null or undefined");
        return t
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = r(466)() ? r(398).Symbol : r(469)
}
, function(t, e, r) {
    "use strict";
    var n = r(395)
      , o = Object.keys || function(t) {
        var e = [];
        for (var r in t)
            e.push(r);
        return e
    }
    ;
    t.exports = _;
    var c = Object.create(r(396));
    c.inherits = r(384);
    var l = r(409)
      , f = r(414);
    c.inherits(_, l);
    for (var h = o(f.prototype), d = 0; d < h.length; d++) {
        var y = h[d];
        _.prototype[y] || (_.prototype[y] = f.prototype[y])
    }
    function _(t) {
        if (!(this instanceof _))
            return new _(t);
        l.call(this, t),
        f.call(this, t),
        t && !1 === t.readable && (this.readable = !1),
        t && !1 === t.writable && (this.writable = !1),
        this.allowHalfOpen = !0,
        t && !1 === t.allowHalfOpen && (this.allowHalfOpen = !1),
        this.once("end", m)
    }
    function m() {
        this.allowHalfOpen || this._writableState.ended || n.nextTick(v, this)
    }
    function v(t) {
        t.end()
    }
    Object.defineProperty(_.prototype, "writableHighWaterMark", {
        enumerable: !1,
        get: function() {
            return this._writableState.highWaterMark
        }
    }),
    Object.defineProperty(_.prototype, "destroyed", {
        get: function() {
            return void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed && this._writableState.destroyed)
        },
        set: function(t) {
            void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = t,
            this._writableState.destroyed = t)
        }
    }),
    _.prototype._destroy = function(t, e) {
        this.push(null),
        this.end(),
        n.nextTick(e, t)
    }
}
, function(t, e, r) {
    var n = r(391)
      , o = n.Buffer;
    function c(t, e) {
        for (var r in t)
            e[r] = t[r]
    }
    function l(t, e, r) {
        return o(t, e, r)
    }
    o.from && o.alloc && o.allocUnsafe && o.allocUnsafeSlow ? t.exports = n : (c(n, e),
    e.Buffer = l),
    l.prototype = Object.create(o.prototype),
    c(o, l),
    l.from = function(t, e, r) {
        if ("number" == typeof t)
            throw new TypeError("Argument must not be a number");
        return o(t, e, r)
    }
    ,
    l.alloc = function(t, e, r) {
        if ("number" != typeof t)
            throw new TypeError("Argument must be a number");
        var n = o(t);
        return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0),
        n
    }
    ,
    l.allocUnsafe = function(t) {
        if ("number" != typeof t)
            throw new TypeError("Argument must be a number");
        return o(t)
    }
    ,
    l.allocUnsafeSlow = function(t) {
        if ("number" != typeof t)
            throw new TypeError("Argument must be a number");
        return n.SlowBuffer(t)
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = function(t) {
        if ("function" != typeof t)
            throw new TypeError(t + " is not a function");
        return t
    }
}
, function(t, e, r) {
    (e = t.exports = r(409)).Stream = e,
    e.Readable = e,
    e.Writable = r(414),
    e.Duplex = r(387),
    e.Transform = r(416),
    e.PassThrough = r(441)
}
, function(t, e, r) {
    "use strict";
    (function(t) {
        var n = r(412)
          , o = r(436)
          , c = r(410);
        function l() {
            return h.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
        }
        function f(t, e) {
            if (l() < e)
                throw new RangeError("Invalid typed array length");
            return h.TYPED_ARRAY_SUPPORT ? (t = new Uint8Array(e)).__proto__ = h.prototype : (null === t && (t = new h(e)),
            t.length = e),
            t
        }
        function h(t, e, r) {
            if (!(h.TYPED_ARRAY_SUPPORT || this instanceof h))
                return new h(t,e,r);
            if ("number" == typeof t) {
                if ("string" == typeof e)
                    throw new Error("If encoding is specified then the first argument must be a string");
                return _(this, t)
            }
            return d(this, t, e, r)
        }
        function d(t, e, r, n) {
            if ("number" == typeof e)
                throw new TypeError('"value" argument must not be a number');
            return "undefined" != typeof ArrayBuffer && e instanceof ArrayBuffer ? function(t, e, r, n) {
                if (e.byteLength,
                r < 0 || e.byteLength < r)
                    throw new RangeError("'offset' is out of bounds");
                if (e.byteLength < r + (n || 0))
                    throw new RangeError("'length' is out of bounds");
                e = void 0 === r && void 0 === n ? new Uint8Array(e) : void 0 === n ? new Uint8Array(e,r) : new Uint8Array(e,r,n);
                h.TYPED_ARRAY_SUPPORT ? (t = e).__proto__ = h.prototype : t = m(t, e);
                return t
            }(t, e, r, n) : "string" == typeof e ? function(t, e, r) {
                "string" == typeof r && "" !== r || (r = "utf8");
                if (!h.isEncoding(r))
                    throw new TypeError('"encoding" must be a valid string encoding');
                var n = 0 | w(e, r)
                  , o = (t = f(t, n)).write(e, r);
                o !== n && (t = t.slice(0, o));
                return t
            }(t, e, r) : function(t, e) {
                if (h.isBuffer(e)) {
                    var r = 0 | v(e.length);
                    return 0 === (t = f(t, r)).length || e.copy(t, 0, 0, r),
                    t
                }
                if (e) {
                    if ("undefined" != typeof ArrayBuffer && e.buffer instanceof ArrayBuffer || "length"in e)
                        return "number" != typeof e.length || (n = e.length) != n ? f(t, 0) : m(t, e);
                    if ("Buffer" === e.type && c(e.data))
                        return m(t, e.data)
                }
                var n;
                throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
            }(t, e)
        }
        function y(t) {
            if ("number" != typeof t)
                throw new TypeError('"size" argument must be a number');
            if (t < 0)
                throw new RangeError('"size" argument must not be negative')
        }
        function _(t, e) {
            if (y(e),
            t = f(t, e < 0 ? 0 : 0 | v(e)),
            !h.TYPED_ARRAY_SUPPORT)
                for (var i = 0; i < e; ++i)
                    t[i] = 0;
            return t
        }
        function m(t, e) {
            var r = e.length < 0 ? 0 : 0 | v(e.length);
            t = f(t, r);
            for (var i = 0; i < r; i += 1)
                t[i] = 255 & e[i];
            return t
        }
        function v(t) {
            if (t >= l())
                throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + l().toString(16) + " bytes");
            return 0 | t
        }
        function w(t, e) {
            if (h.isBuffer(t))
                return t.length;
            if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer))
                return t.byteLength;
            "string" != typeof t && (t = "" + t);
            var r = t.length;
            if (0 === r)
                return 0;
            for (var n = !1; ; )
                switch (e) {
                case "ascii":
                case "latin1":
                case "binary":
                    return r;
                case "utf8":
                case "utf-8":
                case void 0:
                    return Q(t).length;
                case "ucs2":
                case "ucs-2":
                case "utf16le":
                case "utf-16le":
                    return 2 * r;
                case "hex":
                    return r >>> 1;
                case "base64":
                    return $(t).length;
                default:
                    if (n)
                        return Q(t).length;
                    e = ("" + e).toLowerCase(),
                    n = !0
                }
        }
        function S(t, e, r) {
            var n = !1;
            if ((void 0 === e || e < 0) && (e = 0),
            e > this.length)
                return "";
            if ((void 0 === r || r > this.length) && (r = this.length),
            r <= 0)
                return "";
            if ((r >>>= 0) <= (e >>>= 0))
                return "";
            for (t || (t = "utf8"); ; )
                switch (t) {
                case "hex":
                    return N(this, e, r);
                case "utf8":
                case "utf-8":
                    return R(this, e, r);
                case "ascii":
                    return M(this, e, r);
                case "latin1":
                case "binary":
                    return B(this, e, r);
                case "base64":
                    return j(this, e, r);
                case "ucs2":
                case "ucs-2":
                case "utf16le":
                case "utf-16le":
                    return U(this, e, r);
                default:
                    if (n)
                        throw new TypeError("Unknown encoding: " + t);
                    t = (t + "").toLowerCase(),
                    n = !0
                }
        }
        function E(b, t, e) {
            var i = b[t];
            b[t] = b[e],
            b[e] = i
        }
        function k(t, e, r, n, o) {
            if (0 === t.length)
                return -1;
            if ("string" == typeof r ? (n = r,
            r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648),
            r = +r,
            isNaN(r) && (r = o ? 0 : t.length - 1),
            r < 0 && (r = t.length + r),
            r >= t.length) {
                if (o)
                    return -1;
                r = t.length - 1
            } else if (r < 0) {
                if (!o)
                    return -1;
                r = 0
            }
            if ("string" == typeof e && (e = h.from(e, n)),
            h.isBuffer(e))
                return 0 === e.length ? -1 : x(t, e, r, n, o);
            if ("number" == typeof e)
                return e &= 255,
                h.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? o ? Uint8Array.prototype.indexOf.call(t, e, r) : Uint8Array.prototype.lastIndexOf.call(t, e, r) : x(t, [e], r, n, o);
            throw new TypeError("val must be string, number or Buffer")
        }
        function x(t, e, r, n, o) {
            var i, c = 1, l = t.length, f = e.length;
            if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
                if (t.length < 2 || e.length < 2)
                    return -1;
                c = 2,
                l /= 2,
                f /= 2,
                r /= 2
            }
            function h(t, i) {
                return 1 === c ? t[i] : t.readUInt16BE(i * c)
            }
            if (o) {
                var d = -1;
                for (i = r; i < l; i++)
                    if (h(t, i) === h(e, -1 === d ? 0 : i - d)) {
                        if (-1 === d && (d = i),
                        i - d + 1 === f)
                            return d * c
                    } else
                        -1 !== d && (i -= i - d),
                        d = -1
            } else
                for (r + f > l && (r = l - f),
                i = r; i >= 0; i--) {
                    for (var y = !0, _ = 0; _ < f; _++)
                        if (h(t, i + _) !== h(e, _)) {
                            y = !1;
                            break
                        }
                    if (y)
                        return i
                }
            return -1
        }
        function I(t, e, r, n) {
            r = Number(r) || 0;
            var o = t.length - r;
            n ? (n = Number(n)) > o && (n = o) : n = o;
            var c = e.length;
            if (c % 2 != 0)
                throw new TypeError("Invalid hex string");
            n > c / 2 && (n = c / 2);
            for (var i = 0; i < n; ++i) {
                var l = parseInt(e.substr(2 * i, 2), 16);
                if (isNaN(l))
                    return i;
                t[r + i] = l
            }
            return i
        }
        function O(t, e, r, n) {
            return G(Q(e, t.length - r), t, r, n)
        }
        function C(t, e, r, n) {
            return G(function(t) {
                for (var e = [], i = 0; i < t.length; ++i)
                    e.push(255 & t.charCodeAt(i));
                return e
            }(e), t, r, n)
        }
        function A(t, e, r, n) {
            return C(t, e, r, n)
        }
        function P(t, e, r, n) {
            return G($(e), t, r, n)
        }
        function T(t, e, r, n) {
            return G(function(t, e) {
                for (var r, n, o, c = [], i = 0; i < t.length && !((e -= 2) < 0); ++i)
                    r = t.charCodeAt(i),
                    n = r >> 8,
                    o = r % 256,
                    c.push(o),
                    c.push(n);
                return c
            }(e, t.length - r), t, r, n)
        }
        function j(t, e, r) {
            return 0 === e && r === t.length ? n.fromByteArray(t) : n.fromByteArray(t.slice(e, r))
        }
        function R(t, e, r) {
            r = Math.min(t.length, r);
            for (var n = [], i = e; i < r; ) {
                var o, c, l, f, h = t[i], d = null, y = h > 239 ? 4 : h > 223 ? 3 : h > 191 ? 2 : 1;
                if (i + y <= r)
                    switch (y) {
                    case 1:
                        h < 128 && (d = h);
                        break;
                    case 2:
                        128 == (192 & (o = t[i + 1])) && (f = (31 & h) << 6 | 63 & o) > 127 && (d = f);
                        break;
                    case 3:
                        o = t[i + 1],
                        c = t[i + 2],
                        128 == (192 & o) && 128 == (192 & c) && (f = (15 & h) << 12 | (63 & o) << 6 | 63 & c) > 2047 && (f < 55296 || f > 57343) && (d = f);
                        break;
                    case 4:
                        o = t[i + 1],
                        c = t[i + 2],
                        l = t[i + 3],
                        128 == (192 & o) && 128 == (192 & c) && 128 == (192 & l) && (f = (15 & h) << 18 | (63 & o) << 12 | (63 & c) << 6 | 63 & l) > 65535 && f < 1114112 && (d = f)
                    }
                null === d ? (d = 65533,
                y = 1) : d > 65535 && (d -= 65536,
                n.push(d >>> 10 & 1023 | 55296),
                d = 56320 | 1023 & d),
                n.push(d),
                i += y
            }
            return function(t) {
                var e = t.length;
                if (e <= 4096)
                    return String.fromCharCode.apply(String, t);
                var r = ""
                  , i = 0;
                for (; i < e; )
                    r += String.fromCharCode.apply(String, t.slice(i, i += 4096));
                return r
            }(n)
        }
        e.Buffer = h,
        e.SlowBuffer = function(t) {
            +t != t && (t = 0);
            return h.alloc(+t)
        }
        ,
        e.INSPECT_MAX_BYTES = 50,
        h.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : function() {
            try {
                var t = new Uint8Array(1);
                return t.__proto__ = {
                    __proto__: Uint8Array.prototype,
                    foo: function() {
                        return 42
                    }
                },
                42 === t.foo() && "function" == typeof t.subarray && 0 === t.subarray(1, 1).byteLength
            } catch (t) {
                return !1
            }
        }(),
        e.kMaxLength = l(),
        h.poolSize = 8192,
        h._augment = function(t) {
            return t.__proto__ = h.prototype,
            t
        }
        ,
        h.from = function(t, e, r) {
            return d(null, t, e, r)
        }
        ,
        h.TYPED_ARRAY_SUPPORT && (h.prototype.__proto__ = Uint8Array.prototype,
        h.__proto__ = Uint8Array,
        "undefined" != typeof Symbol && Symbol.species && h[Symbol.species] === h && Object.defineProperty(h, Symbol.species, {
            value: null,
            configurable: !0
        })),
        h.alloc = function(t, e, r) {
            return function(t, e, r, n) {
                return y(e),
                e <= 0 ? f(t, e) : void 0 !== r ? "string" == typeof n ? f(t, e).fill(r, n) : f(t, e).fill(r) : f(t, e)
            }(null, t, e, r)
        }
        ,
        h.allocUnsafe = function(t) {
            return _(null, t)
        }
        ,
        h.allocUnsafeSlow = function(t) {
            return _(null, t)
        }
        ,
        h.isBuffer = function(b) {
            return !(null == b || !b._isBuffer)
        }
        ,
        h.compare = function(a, b) {
            if (!h.isBuffer(a) || !h.isBuffer(b))
                throw new TypeError("Arguments must be Buffers");
            if (a === b)
                return 0;
            for (var t = a.length, e = b.length, i = 0, r = Math.min(t, e); i < r; ++i)
                if (a[i] !== b[i]) {
                    t = a[i],
                    e = b[i];
                    break
                }
            return t < e ? -1 : e < t ? 1 : 0
        }
        ,
        h.isEncoding = function(t) {
            switch (String(t).toLowerCase()) {
            case "hex":
            case "utf8":
            case "utf-8":
            case "ascii":
            case "latin1":
            case "binary":
            case "base64":
            case "ucs2":
            case "ucs-2":
            case "utf16le":
            case "utf-16le":
                return !0;
            default:
                return !1
            }
        }
        ,
        h.concat = function(t, e) {
            if (!c(t))
                throw new TypeError('"list" argument must be an Array of Buffers');
            if (0 === t.length)
                return h.alloc(0);
            var i;
            if (void 0 === e)
                for (e = 0,
                i = 0; i < t.length; ++i)
                    e += t[i].length;
            var r = h.allocUnsafe(e)
              , n = 0;
            for (i = 0; i < t.length; ++i) {
                var o = t[i];
                if (!h.isBuffer(o))
                    throw new TypeError('"list" argument must be an Array of Buffers');
                o.copy(r, n),
                n += o.length
            }
            return r
        }
        ,
        h.byteLength = w,
        h.prototype._isBuffer = !0,
        h.prototype.swap16 = function() {
            var t = this.length;
            if (t % 2 != 0)
                throw new RangeError("Buffer size must be a multiple of 16-bits");
            for (var i = 0; i < t; i += 2)
                E(this, i, i + 1);
            return this
        }
        ,
        h.prototype.swap32 = function() {
            var t = this.length;
            if (t % 4 != 0)
                throw new RangeError("Buffer size must be a multiple of 32-bits");
            for (var i = 0; i < t; i += 4)
                E(this, i, i + 3),
                E(this, i + 1, i + 2);
            return this
        }
        ,
        h.prototype.swap64 = function() {
            var t = this.length;
            if (t % 8 != 0)
                throw new RangeError("Buffer size must be a multiple of 64-bits");
            for (var i = 0; i < t; i += 8)
                E(this, i, i + 7),
                E(this, i + 1, i + 6),
                E(this, i + 2, i + 5),
                E(this, i + 3, i + 4);
            return this
        }
        ,
        h.prototype.toString = function() {
            var t = 0 | this.length;
            return 0 === t ? "" : 0 === arguments.length ? R(this, 0, t) : S.apply(this, arguments)
        }
        ,
        h.prototype.equals = function(b) {
            if (!h.isBuffer(b))
                throw new TypeError("Argument must be a Buffer");
            return this === b || 0 === h.compare(this, b)
        }
        ,
        h.prototype.inspect = function() {
            var t = ""
              , r = e.INSPECT_MAX_BYTES;
            return this.length > 0 && (t = this.toString("hex", 0, r).match(/.{2}/g).join(" "),
            this.length > r && (t += " ... ")),
            "<Buffer " + t + ">"
        }
        ,
        h.prototype.compare = function(t, e, r, n, o) {
            if (!h.isBuffer(t))
                throw new TypeError("Argument must be a Buffer");
            if (void 0 === e && (e = 0),
            void 0 === r && (r = t ? t.length : 0),
            void 0 === n && (n = 0),
            void 0 === o && (o = this.length),
            e < 0 || r > t.length || n < 0 || o > this.length)
                throw new RangeError("out of range index");
            if (n >= o && e >= r)
                return 0;
            if (n >= o)
                return -1;
            if (e >= r)
                return 1;
            if (this === t)
                return 0;
            for (var c = (o >>>= 0) - (n >>>= 0), l = (r >>>= 0) - (e >>>= 0), f = Math.min(c, l), d = this.slice(n, o), y = t.slice(e, r), i = 0; i < f; ++i)
                if (d[i] !== y[i]) {
                    c = d[i],
                    l = y[i];
                    break
                }
            return c < l ? -1 : l < c ? 1 : 0
        }
        ,
        h.prototype.includes = function(t, e, r) {
            return -1 !== this.indexOf(t, e, r)
        }
        ,
        h.prototype.indexOf = function(t, e, r) {
            return k(this, t, e, r, !0)
        }
        ,
        h.prototype.lastIndexOf = function(t, e, r) {
            return k(this, t, e, r, !1)
        }
        ,
        h.prototype.write = function(t, e, r, n) {
            if (void 0 === e)
                n = "utf8",
                r = this.length,
                e = 0;
            else if (void 0 === r && "string" == typeof e)
                n = e,
                r = this.length,
                e = 0;
            else {
                if (!isFinite(e))
                    throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
                e |= 0,
                isFinite(r) ? (r |= 0,
                void 0 === n && (n = "utf8")) : (n = r,
                r = void 0)
            }
            var o = this.length - e;
            if ((void 0 === r || r > o) && (r = o),
            t.length > 0 && (r < 0 || e < 0) || e > this.length)
                throw new RangeError("Attempt to write outside buffer bounds");
            n || (n = "utf8");
            for (var c = !1; ; )
                switch (n) {
                case "hex":
                    return I(this, t, e, r);
                case "utf8":
                case "utf-8":
                    return O(this, t, e, r);
                case "ascii":
                    return C(this, t, e, r);
                case "latin1":
                case "binary":
                    return A(this, t, e, r);
                case "base64":
                    return P(this, t, e, r);
                case "ucs2":
                case "ucs-2":
                case "utf16le":
                case "utf-16le":
                    return T(this, t, e, r);
                default:
                    if (c)
                        throw new TypeError("Unknown encoding: " + n);
                    n = ("" + n).toLowerCase(),
                    c = !0
                }
        }
        ,
        h.prototype.toJSON = function() {
            return {
                type: "Buffer",
                data: Array.prototype.slice.call(this._arr || this, 0)
            }
        }
        ;
        function M(t, e, r) {
            var n = "";
            r = Math.min(t.length, r);
            for (var i = e; i < r; ++i)
                n += String.fromCharCode(127 & t[i]);
            return n
        }
        function B(t, e, r) {
            var n = "";
            r = Math.min(t.length, r);
            for (var i = e; i < r; ++i)
                n += String.fromCharCode(t[i]);
            return n
        }
        function N(t, e, r) {
            var n = t.length;
            (!e || e < 0) && (e = 0),
            (!r || r < 0 || r > n) && (r = n);
            for (var o = "", i = e; i < r; ++i)
                o += Y(t[i]);
            return o
        }
        function U(t, e, r) {
            for (var n = t.slice(e, r), o = "", i = 0; i < n.length; i += 2)
                o += String.fromCharCode(n[i] + 256 * n[i + 1]);
            return o
        }
        function L(t, e, r) {
            if (t % 1 != 0 || t < 0)
                throw new RangeError("offset is not uint");
            if (t + e > r)
                throw new RangeError("Trying to access beyond buffer length")
        }
        function D(t, e, r, n, o, c) {
            if (!h.isBuffer(t))
                throw new TypeError('"buffer" argument must be a Buffer instance');
            if (e > o || e < c)
                throw new RangeError('"value" argument is out of bounds');
            if (r + n > t.length)
                throw new RangeError("Index out of range")
        }
        function F(t, e, r, n) {
            e < 0 && (e = 65535 + e + 1);
            for (var i = 0, o = Math.min(t.length - r, 2); i < o; ++i)
                t[r + i] = (e & 255 << 8 * (n ? i : 1 - i)) >>> 8 * (n ? i : 1 - i)
        }
        function z(t, e, r, n) {
            e < 0 && (e = 4294967295 + e + 1);
            for (var i = 0, o = Math.min(t.length - r, 4); i < o; ++i)
                t[r + i] = e >>> 8 * (n ? i : 3 - i) & 255
        }
        function K(t, e, r, n, o, c) {
            if (r + n > t.length)
                throw new RangeError("Index out of range");
            if (r < 0)
                throw new RangeError("Index out of range")
        }
        function W(t, e, r, n, c) {
            return c || K(t, 0, r, 4),
            o.write(t, e, r, n, 23, 4),
            r + 4
        }
        function H(t, e, r, n, c) {
            return c || K(t, 0, r, 8),
            o.write(t, e, r, n, 52, 8),
            r + 8
        }
        h.prototype.slice = function(t, e) {
            var r, n = this.length;
            if ((t = ~~t) < 0 ? (t += n) < 0 && (t = 0) : t > n && (t = n),
            (e = void 0 === e ? n : ~~e) < 0 ? (e += n) < 0 && (e = 0) : e > n && (e = n),
            e < t && (e = t),
            h.TYPED_ARRAY_SUPPORT)
                (r = this.subarray(t, e)).__proto__ = h.prototype;
            else {
                var o = e - t;
                r = new h(o,void 0);
                for (var i = 0; i < o; ++i)
                    r[i] = this[i + t]
            }
            return r
        }
        ,
        h.prototype.readUIntLE = function(t, e, r) {
            t |= 0,
            e |= 0,
            r || L(t, e, this.length);
            for (var n = this[t], o = 1, i = 0; ++i < e && (o *= 256); )
                n += this[t + i] * o;
            return n
        }
        ,
        h.prototype.readUIntBE = function(t, e, r) {
            t |= 0,
            e |= 0,
            r || L(t, e, this.length);
            for (var n = this[t + --e], o = 1; e > 0 && (o *= 256); )
                n += this[t + --e] * o;
            return n
        }
        ,
        h.prototype.readUInt8 = function(t, e) {
            return e || L(t, 1, this.length),
            this[t]
        }
        ,
        h.prototype.readUInt16LE = function(t, e) {
            return e || L(t, 2, this.length),
            this[t] | this[t + 1] << 8
        }
        ,
        h.prototype.readUInt16BE = function(t, e) {
            return e || L(t, 2, this.length),
            this[t] << 8 | this[t + 1]
        }
        ,
        h.prototype.readUInt32LE = function(t, e) {
            return e || L(t, 4, this.length),
            (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3]
        }
        ,
        h.prototype.readUInt32BE = function(t, e) {
            return e || L(t, 4, this.length),
            16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3])
        }
        ,
        h.prototype.readIntLE = function(t, e, r) {
            t |= 0,
            e |= 0,
            r || L(t, e, this.length);
            for (var n = this[t], o = 1, i = 0; ++i < e && (o *= 256); )
                n += this[t + i] * o;
            return n >= (o *= 128) && (n -= Math.pow(2, 8 * e)),
            n
        }
        ,
        h.prototype.readIntBE = function(t, e, r) {
            t |= 0,
            e |= 0,
            r || L(t, e, this.length);
            for (var i = e, n = 1, o = this[t + --i]; i > 0 && (n *= 256); )
                o += this[t + --i] * n;
            return o >= (n *= 128) && (o -= Math.pow(2, 8 * e)),
            o
        }
        ,
        h.prototype.readInt8 = function(t, e) {
            return e || L(t, 1, this.length),
            128 & this[t] ? -1 * (255 - this[t] + 1) : this[t]
        }
        ,
        h.prototype.readInt16LE = function(t, e) {
            e || L(t, 2, this.length);
            var r = this[t] | this[t + 1] << 8;
            return 32768 & r ? 4294901760 | r : r
        }
        ,
        h.prototype.readInt16BE = function(t, e) {
            e || L(t, 2, this.length);
            var r = this[t + 1] | this[t] << 8;
            return 32768 & r ? 4294901760 | r : r
        }
        ,
        h.prototype.readInt32LE = function(t, e) {
            return e || L(t, 4, this.length),
            this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24
        }
        ,
        h.prototype.readInt32BE = function(t, e) {
            return e || L(t, 4, this.length),
            this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]
        }
        ,
        h.prototype.readFloatLE = function(t, e) {
            return e || L(t, 4, this.length),
            o.read(this, t, !0, 23, 4)
        }
        ,
        h.prototype.readFloatBE = function(t, e) {
            return e || L(t, 4, this.length),
            o.read(this, t, !1, 23, 4)
        }
        ,
        h.prototype.readDoubleLE = function(t, e) {
            return e || L(t, 8, this.length),
            o.read(this, t, !0, 52, 8)
        }
        ,
        h.prototype.readDoubleBE = function(t, e) {
            return e || L(t, 8, this.length),
            o.read(this, t, !1, 52, 8)
        }
        ,
        h.prototype.writeUIntLE = function(t, e, r, n) {
            (t = +t,
            e |= 0,
            r |= 0,
            n) || D(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
            var o = 1
              , i = 0;
            for (this[e] = 255 & t; ++i < r && (o *= 256); )
                this[e + i] = t / o & 255;
            return e + r
        }
        ,
        h.prototype.writeUIntBE = function(t, e, r, n) {
            (t = +t,
            e |= 0,
            r |= 0,
            n) || D(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
            var i = r - 1
              , o = 1;
            for (this[e + i] = 255 & t; --i >= 0 && (o *= 256); )
                this[e + i] = t / o & 255;
            return e + r
        }
        ,
        h.prototype.writeUInt8 = function(t, e, r) {
            return t = +t,
            e |= 0,
            r || D(this, t, e, 1, 255, 0),
            h.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)),
            this[e] = 255 & t,
            e + 1
        }
        ,
        h.prototype.writeUInt16LE = function(t, e, r) {
            return t = +t,
            e |= 0,
            r || D(this, t, e, 2, 65535, 0),
            h.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t,
            this[e + 1] = t >>> 8) : F(this, t, e, !0),
            e + 2
        }
        ,
        h.prototype.writeUInt16BE = function(t, e, r) {
            return t = +t,
            e |= 0,
            r || D(this, t, e, 2, 65535, 0),
            h.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8,
            this[e + 1] = 255 & t) : F(this, t, e, !1),
            e + 2
        }
        ,
        h.prototype.writeUInt32LE = function(t, e, r) {
            return t = +t,
            e |= 0,
            r || D(this, t, e, 4, 4294967295, 0),
            h.TYPED_ARRAY_SUPPORT ? (this[e + 3] = t >>> 24,
            this[e + 2] = t >>> 16,
            this[e + 1] = t >>> 8,
            this[e] = 255 & t) : z(this, t, e, !0),
            e + 4
        }
        ,
        h.prototype.writeUInt32BE = function(t, e, r) {
            return t = +t,
            e |= 0,
            r || D(this, t, e, 4, 4294967295, 0),
            h.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24,
            this[e + 1] = t >>> 16,
            this[e + 2] = t >>> 8,
            this[e + 3] = 255 & t) : z(this, t, e, !1),
            e + 4
        }
        ,
        h.prototype.writeIntLE = function(t, e, r, n) {
            if (t = +t,
            e |= 0,
            !n) {
                var o = Math.pow(2, 8 * r - 1);
                D(this, t, e, r, o - 1, -o)
            }
            var i = 0
              , c = 1
              , sub = 0;
            for (this[e] = 255 & t; ++i < r && (c *= 256); )
                t < 0 && 0 === sub && 0 !== this[e + i - 1] && (sub = 1),
                this[e + i] = (t / c >> 0) - sub & 255;
            return e + r
        }
        ,
        h.prototype.writeIntBE = function(t, e, r, n) {
            if (t = +t,
            e |= 0,
            !n) {
                var o = Math.pow(2, 8 * r - 1);
                D(this, t, e, r, o - 1, -o)
            }
            var i = r - 1
              , c = 1
              , sub = 0;
            for (this[e + i] = 255 & t; --i >= 0 && (c *= 256); )
                t < 0 && 0 === sub && 0 !== this[e + i + 1] && (sub = 1),
                this[e + i] = (t / c >> 0) - sub & 255;
            return e + r
        }
        ,
        h.prototype.writeInt8 = function(t, e, r) {
            return t = +t,
            e |= 0,
            r || D(this, t, e, 1, 127, -128),
            h.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)),
            t < 0 && (t = 255 + t + 1),
            this[e] = 255 & t,
            e + 1
        }
        ,
        h.prototype.writeInt16LE = function(t, e, r) {
            return t = +t,
            e |= 0,
            r || D(this, t, e, 2, 32767, -32768),
            h.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t,
            this[e + 1] = t >>> 8) : F(this, t, e, !0),
            e + 2
        }
        ,
        h.prototype.writeInt16BE = function(t, e, r) {
            return t = +t,
            e |= 0,
            r || D(this, t, e, 2, 32767, -32768),
            h.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8,
            this[e + 1] = 255 & t) : F(this, t, e, !1),
            e + 2
        }
        ,
        h.prototype.writeInt32LE = function(t, e, r) {
            return t = +t,
            e |= 0,
            r || D(this, t, e, 4, 2147483647, -2147483648),
            h.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t,
            this[e + 1] = t >>> 8,
            this[e + 2] = t >>> 16,
            this[e + 3] = t >>> 24) : z(this, t, e, !0),
            e + 4
        }
        ,
        h.prototype.writeInt32BE = function(t, e, r) {
            return t = +t,
            e |= 0,
            r || D(this, t, e, 4, 2147483647, -2147483648),
            t < 0 && (t = 4294967295 + t + 1),
            h.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24,
            this[e + 1] = t >>> 16,
            this[e + 2] = t >>> 8,
            this[e + 3] = 255 & t) : z(this, t, e, !1),
            e + 4
        }
        ,
        h.prototype.writeFloatLE = function(t, e, r) {
            return W(this, t, e, !0, r)
        }
        ,
        h.prototype.writeFloatBE = function(t, e, r) {
            return W(this, t, e, !1, r)
        }
        ,
        h.prototype.writeDoubleLE = function(t, e, r) {
            return H(this, t, e, !0, r)
        }
        ,
        h.prototype.writeDoubleBE = function(t, e, r) {
            return H(this, t, e, !1, r)
        }
        ,
        h.prototype.copy = function(t, e, r, n) {
            if (r || (r = 0),
            n || 0 === n || (n = this.length),
            e >= t.length && (e = t.length),
            e || (e = 0),
            n > 0 && n < r && (n = r),
            n === r)
                return 0;
            if (0 === t.length || 0 === this.length)
                return 0;
            if (e < 0)
                throw new RangeError("targetStart out of bounds");
            if (r < 0 || r >= this.length)
                throw new RangeError("sourceStart out of bounds");
            if (n < 0)
                throw new RangeError("sourceEnd out of bounds");
            n > this.length && (n = this.length),
            t.length - e < n - r && (n = t.length - e + r);
            var i, o = n - r;
            if (this === t && r < e && e < n)
                for (i = o - 1; i >= 0; --i)
                    t[i + e] = this[i + r];
            else if (o < 1e3 || !h.TYPED_ARRAY_SUPPORT)
                for (i = 0; i < o; ++i)
                    t[i + e] = this[i + r];
            else
                Uint8Array.prototype.set.call(t, this.subarray(r, r + o), e);
            return o
        }
        ,
        h.prototype.fill = function(t, e, r, n) {
            if ("string" == typeof t) {
                if ("string" == typeof e ? (n = e,
                e = 0,
                r = this.length) : "string" == typeof r && (n = r,
                r = this.length),
                1 === t.length) {
                    var code = t.charCodeAt(0);
                    code < 256 && (t = code)
                }
                if (void 0 !== n && "string" != typeof n)
                    throw new TypeError("encoding must be a string");
                if ("string" == typeof n && !h.isEncoding(n))
                    throw new TypeError("Unknown encoding: " + n)
            } else
                "number" == typeof t && (t &= 255);
            if (e < 0 || this.length < e || this.length < r)
                throw new RangeError("Out of range index");
            if (r <= e)
                return this;
            var i;
            if (e >>>= 0,
            r = void 0 === r ? this.length : r >>> 0,
            t || (t = 0),
            "number" == typeof t)
                for (i = e; i < r; ++i)
                    this[i] = t;
            else {
                var o = h.isBuffer(t) ? t : Q(new h(t,n).toString())
                  , c = o.length;
                for (i = 0; i < r - e; ++i)
                    this[i + e] = o[i % c]
            }
            return this
        }
        ;
        var V = /[^+\/0-9A-Za-z-_]/g;
        function Y(t) {
            return t < 16 ? "0" + t.toString(16) : t.toString(16)
        }
        function Q(t, e) {
            var r;
            e = e || 1 / 0;
            for (var n = t.length, o = null, c = [], i = 0; i < n; ++i) {
                if ((r = t.charCodeAt(i)) > 55295 && r < 57344) {
                    if (!o) {
                        if (r > 56319) {
                            (e -= 3) > -1 && c.push(239, 191, 189);
                            continue
                        }
                        if (i + 1 === n) {
                            (e -= 3) > -1 && c.push(239, 191, 189);
                            continue
                        }
                        o = r;
                        continue
                    }
                    if (r < 56320) {
                        (e -= 3) > -1 && c.push(239, 191, 189),
                        o = r;
                        continue
                    }
                    r = 65536 + (o - 55296 << 10 | r - 56320)
                } else
                    o && (e -= 3) > -1 && c.push(239, 191, 189);
                if (o = null,
                r < 128) {
                    if ((e -= 1) < 0)
                        break;
                    c.push(r)
                } else if (r < 2048) {
                    if ((e -= 2) < 0)
                        break;
                    c.push(r >> 6 | 192, 63 & r | 128)
                } else if (r < 65536) {
                    if ((e -= 3) < 0)
                        break;
                    c.push(r >> 12 | 224, r >> 6 & 63 | 128, 63 & r | 128)
                } else {
                    if (!(r < 1114112))
                        throw new Error("Invalid code point");
                    if ((e -= 4) < 0)
                        break;
                    c.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 | 128, 63 & r | 128)
                }
            }
            return c
        }
        function $(t) {
            return n.toByteArray(function(t) {
                if ((t = function(t) {
                    return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")
                }(t).replace(V, "")).length < 2)
                    return "";
                for (; t.length % 4 != 0; )
                    t += "=";
                return t
            }(t))
        }
        function G(t, e, r, n) {
            for (var i = 0; i < n && !(i + r >= e.length || i >= t.length); ++i)
                e[i + r] = t[i];
            return i
        }
    }
    ).call(this, r(29))
}
, function(t, e, r) {
    "use strict";
    var n = r(445)();
    t.exports = function(t) {
        return t !== n && null !== t
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = function(t) {
        return null != t
    }
}
, function(t, e, r) {
    "use strict";
    var n, o = "object" == typeof Reflect ? Reflect : null, c = o && "function" == typeof o.apply ? o.apply : function(t, e, r) {
        return Function.prototype.apply.call(t, e, r)
    }
    ;
    n = o && "function" == typeof o.ownKeys ? o.ownKeys : Object.getOwnPropertySymbols ? function(t) {
        return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))
    }
    : function(t) {
        return Object.getOwnPropertyNames(t)
    }
    ;
    var l = Number.isNaN || function(t) {
        return t != t
    }
    ;
    function f() {
        f.init.call(this)
    }
    t.exports = f,
    f.EventEmitter = f,
    f.prototype._events = void 0,
    f.prototype._eventsCount = 0,
    f.prototype._maxListeners = void 0;
    var h = 10;
    function d(t) {
        if ("function" != typeof t)
            throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t)
    }
    function y(t) {
        return void 0 === t._maxListeners ? f.defaultMaxListeners : t._maxListeners
    }
    function _(t, e, r, n) {
        var o, c, l, f;
        if (d(r),
        void 0 === (c = t._events) ? (c = t._events = Object.create(null),
        t._eventsCount = 0) : (void 0 !== c.newListener && (t.emit("newListener", e, r.listener ? r.listener : r),
        c = t._events),
        l = c[e]),
        void 0 === l)
            l = c[e] = r,
            ++t._eventsCount;
        else if ("function" == typeof l ? l = c[e] = n ? [r, l] : [l, r] : n ? l.unshift(r) : l.push(r),
        (o = y(t)) > 0 && l.length > o && !l.warned) {
            l.warned = !0;
            var h = new Error("Possible EventEmitter memory leak detected. " + l.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
            h.name = "MaxListenersExceededWarning",
            h.emitter = t,
            h.type = e,
            h.count = l.length,
            f = h,
            console && console.warn && console.warn(f)
        }
        return t
    }
    function m() {
        if (!this.fired)
            return this.target.removeListener(this.type, this.wrapFn),
            this.fired = !0,
            0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments)
    }
    function v(t, e, r) {
        var n = {
            fired: !1,
            wrapFn: void 0,
            target: t,
            type: e,
            listener: r
        }
          , o = m.bind(n);
        return o.listener = r,
        n.wrapFn = o,
        o
    }
    function w(t, e, r) {
        var n = t._events;
        if (void 0 === n)
            return [];
        var o = n[e];
        return void 0 === o ? [] : "function" == typeof o ? r ? [o.listener || o] : [o] : r ? function(t) {
            for (var e = new Array(t.length), i = 0; i < e.length; ++i)
                e[i] = t[i].listener || t[i];
            return e
        }(o) : E(o, o.length)
    }
    function S(t) {
        var e = this._events;
        if (void 0 !== e) {
            var r = e[t];
            if ("function" == typeof r)
                return 1;
            if (void 0 !== r)
                return r.length
        }
        return 0
    }
    function E(t, e) {
        for (var r = new Array(e), i = 0; i < e; ++i)
            r[i] = t[i];
        return r
    }
    Object.defineProperty(f, "defaultMaxListeners", {
        enumerable: !0,
        get: function() {
            return h
        },
        set: function(t) {
            if ("number" != typeof t || t < 0 || l(t))
                throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
            h = t
        }
    }),
    f.init = function() {
        void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = Object.create(null),
        this._eventsCount = 0),
        this._maxListeners = this._maxListeners || void 0
    }
    ,
    f.prototype.setMaxListeners = function(t) {
        if ("number" != typeof t || t < 0 || l(t))
            throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + ".");
        return this._maxListeners = t,
        this
    }
    ,
    f.prototype.getMaxListeners = function() {
        return y(this)
    }
    ,
    f.prototype.emit = function(t) {
        for (var e = [], i = 1; i < arguments.length; i++)
            e.push(arguments[i]);
        var r = "error" === t
          , n = this._events;
        if (void 0 !== n)
            r = r && void 0 === n.error;
        else if (!r)
            return !1;
        if (r) {
            var o;
            if (e.length > 0 && (o = e[0]),
            o instanceof Error)
                throw o;
            var l = new Error("Unhandled error." + (o ? " (" + o.message + ")" : ""));
            throw l.context = o,
            l
        }
        var f = n[t];
        if (void 0 === f)
            return !1;
        if ("function" == typeof f)
            c(f, this, e);
        else {
            var h = f.length
              , d = E(f, h);
            for (i = 0; i < h; ++i)
                c(d[i], this, e)
        }
        return !0
    }
    ,
    f.prototype.addListener = function(t, e) {
        return _(this, t, e, !1)
    }
    ,
    f.prototype.on = f.prototype.addListener,
    f.prototype.prependListener = function(t, e) {
        return _(this, t, e, !0)
    }
    ,
    f.prototype.once = function(t, e) {
        return d(e),
        this.on(t, v(this, t, e)),
        this
    }
    ,
    f.prototype.prependOnceListener = function(t, e) {
        return d(e),
        this.prependListener(t, v(this, t, e)),
        this
    }
    ,
    f.prototype.removeListener = function(t, e) {
        var r, n, o, i, c;
        if (d(e),
        void 0 === (n = this._events))
            return this;
        if (void 0 === (r = n[t]))
            return this;
        if (r === e || r.listener === e)
            0 == --this._eventsCount ? this._events = Object.create(null) : (delete n[t],
            n.removeListener && this.emit("removeListener", t, r.listener || e));
        else if ("function" != typeof r) {
            for (o = -1,
            i = r.length - 1; i >= 0; i--)
                if (r[i] === e || r[i].listener === e) {
                    c = r[i].listener,
                    o = i;
                    break
                }
            if (o < 0)
                return this;
            0 === o ? r.shift() : function(t, e) {
                for (; e + 1 < t.length; e++)
                    t[e] = t[e + 1];
                t.pop()
            }(r, o),
            1 === r.length && (n[t] = r[0]),
            void 0 !== n.removeListener && this.emit("removeListener", t, c || e)
        }
        return this
    }
    ,
    f.prototype.off = f.prototype.removeListener,
    f.prototype.removeAllListeners = function(t) {
        var e, r, i;
        if (void 0 === (r = this._events))
            return this;
        if (void 0 === r.removeListener)
            return 0 === arguments.length ? (this._events = Object.create(null),
            this._eventsCount = 0) : void 0 !== r[t] && (0 == --this._eventsCount ? this._events = Object.create(null) : delete r[t]),
            this;
        if (0 === arguments.length) {
            var n, o = Object.keys(r);
            for (i = 0; i < o.length; ++i)
                "removeListener" !== (n = o[i]) && this.removeAllListeners(n);
            return this.removeAllListeners("removeListener"),
            this._events = Object.create(null),
            this._eventsCount = 0,
            this
        }
        if ("function" == typeof (e = r[t]))
            this.removeListener(t, e);
        else if (void 0 !== e)
            for (i = e.length - 1; i >= 0; i--)
                this.removeListener(t, e[i]);
        return this
    }
    ,
    f.prototype.listeners = function(t) {
        return w(this, t, !0)
    }
    ,
    f.prototype.rawListeners = function(t) {
        return w(this, t, !1)
    }
    ,
    f.listenerCount = function(t, e) {
        return "function" == typeof t.listenerCount ? t.listenerCount(e) : S.call(t, e)
    }
    ,
    f.prototype.listenerCount = S,
    f.prototype.eventNames = function() {
        return this._eventsCount > 0 ? n(this._events) : []
    }
}
, function(t, e, r) {
    "use strict";
    (function(e) {
        void 0 === e || !e.version || 0 === e.version.indexOf("v0.") || 0 === e.version.indexOf("v1.") && 0 !== e.version.indexOf("v1.8.") ? t.exports = {
            nextTick: function(t, r, n, o) {
                if ("function" != typeof t)
                    throw new TypeError('"callback" argument must be a function');
                var c, i, l = arguments.length;
                switch (l) {
                case 0:
                case 1:
                    return e.nextTick(t);
                case 2:
                    return e.nextTick((function() {
                        t.call(null, r)
                    }
                    ));
                case 3:
                    return e.nextTick((function() {
                        t.call(null, r, n)
                    }
                    ));
                case 4:
                    return e.nextTick((function() {
                        t.call(null, r, n, o)
                    }
                    ));
                default:
                    for (c = new Array(l - 1),
                    i = 0; i < c.length; )
                        c[i++] = arguments[i];
                    return e.nextTick((function() {
                        t.apply(null, c)
                    }
                    ))
                }
            }
        } : t.exports = e
    }
    ).call(this, r(147))
}
, function(t, e, r) {
    (function(t) {
        function r(t) {
            return Object.prototype.toString.call(t)
        }
        e.isArray = function(t) {
            return Array.isArray ? Array.isArray(t) : "[object Array]" === r(t)
        }
        ,
        e.isBoolean = function(t) {
            return "boolean" == typeof t
        }
        ,
        e.isNull = function(t) {
            return null === t
        }
        ,
        e.isNullOrUndefined = function(t) {
            return null == t
        }
        ,
        e.isNumber = function(t) {
            return "number" == typeof t
        }
        ,
        e.isString = function(t) {
            return "string" == typeof t
        }
        ,
        e.isSymbol = function(t) {
            return "symbol" == typeof t
        }
        ,
        e.isUndefined = function(t) {
            return void 0 === t
        }
        ,
        e.isRegExp = function(t) {
            return "[object RegExp]" === r(t)
        }
        ,
        e.isObject = function(t) {
            return "object" == typeof t && null !== t
        }
        ,
        e.isDate = function(t) {
            return "[object Date]" === r(t)
        }
        ,
        e.isError = function(t) {
            return "[object Error]" === r(t) || t instanceof Error
        }
        ,
        e.isFunction = function(t) {
            return "function" == typeof t
        }
        ,
        e.isPrimitive = function(t) {
            return null === t || "boolean" == typeof t || "number" == typeof t || "string" == typeof t || "symbol" == typeof t || void 0 === t
        }
        ,
        e.isBuffer = t.isBuffer
    }
    ).call(this, r(391).Buffer)
}
, function(t, e, r) {
    "use strict";
    t.exports = r(419)() ? Object.setPrototypeOf : r(420)
}
, function(t, e, r) {
    "use strict";
    t.exports = r(467)() ? globalThis : r(468)
}
, function(t, e, r) {
    "use strict";
    var n = Object.prototype.toString
      , o = n.call(function() {
        return arguments
    }());
    t.exports = function(t) {
        return n.call(t) === o
    }
}
, function(t, e, r) {
    "use strict";
    var n = Object.prototype.toString
      , o = n.call("");
    t.exports = function(t) {
        return "string" == typeof t || t && "object" == typeof t && (t instanceof String || n.call(t) === o) || !1
    }
}
, function(t, e) {
    t.exports = function() {
        for (var t = {}, i = 0; i < arguments.length; i++) {
            var source = arguments[i];
            for (var e in source)
                r.call(source, e) && (t[e] = source[e])
        }
        return t
    }
    ;
    var r = Object.prototype.hasOwnProperty
}
, function(t, e, r) {
    var n = r(391)
      , o = n.Buffer;
    function c(t, e) {
        for (var r in t)
            e[r] = t[r]
    }
    function l(t, e, r) {
        return o(t, e, r)
    }
    o.from && o.alloc && o.allocUnsafe && o.allocUnsafeSlow ? t.exports = n : (c(n, e),
    e.Buffer = l),
    c(o, l),
    l.from = function(t, e, r) {
        if ("number" == typeof t)
            throw new TypeError("Argument must not be a number");
        return o(t, e, r)
    }
    ,
    l.alloc = function(t, e, r) {
        if ("number" != typeof t)
            throw new TypeError("Argument must be a number");
        var n = o(t);
        return void 0 !== e ? "string" == typeof r ? n.fill(e, r) : n.fill(e) : n.fill(0),
        n
    }
    ,
    l.allocUnsafe = function(t) {
        if ("number" != typeof t)
            throw new TypeError("Argument must be a number");
        return o(t)
    }
    ,
    l.allocUnsafeSlow = function(t) {
        if ("number" != typeof t)
            throw new TypeError("Argument must be a number");
        return n.SlowBuffer(t)
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(393)
      , o = {
        object: !0,
        function: !0,
        undefined: !0
    };
    t.exports = function(t) {
        return !!n(t) && hasOwnProperty.call(o, typeof t)
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = r(458)() ? Object.assign : r(459)
}
, function(t, e, r) {
    "use strict";
    var n, o = r(417), c = r(404), l = r(389), f = r(385), h = r(383), d = r(478), y = r(386), _ = Object.defineProperty, m = Object.defineProperties;
    t.exports = n = function(t, e) {
        if (!(this instanceof n))
            throw new TypeError("Constructor requires 'new'");
        m(this, {
            __list__: h("w", f(t)),
            __context__: h("w", e),
            __nextIndex__: h("w", 0)
        }),
        e && (l(e.on),
        e.on("_add", this._onAdd),
        e.on("_delete", this._onDelete),
        e.on("_clear", this._onClear))
    }
    ,
    delete n.prototype.constructor,
    m(n.prototype, c({
        _next: h((function() {
            var i;
            if (this.__list__)
                return this.__redo__ && void 0 !== (i = this.__redo__.shift()) ? i : this.__nextIndex__ < this.__list__.length ? this.__nextIndex__++ : void this._unBind()
        }
        )),
        next: h((function() {
            return this._createResult(this._next())
        }
        )),
        _createResult: h((function(i) {
            return void 0 === i ? {
                done: !0,
                value: void 0
            } : {
                done: !1,
                value: this._resolve(i)
            }
        }
        )),
        _resolve: h((function(i) {
            return this.__list__[i]
        }
        )),
        _unBind: h((function() {
            this.__list__ = null,
            delete this.__redo__,
            this.__context__ && (this.__context__.off("_add", this._onAdd),
            this.__context__.off("_delete", this._onDelete),
            this.__context__.off("_clear", this._onClear),
            this.__context__ = null)
        }
        )),
        toString: h((function() {
            return "[object " + (this[y.toStringTag] || "Object") + "]"
        }
        ))
    }, d({
        _onAdd: h((function(t) {
            t >= this.__nextIndex__ || (++this.__nextIndex__,
            this.__redo__ ? (this.__redo__.forEach((function(e, i) {
                e >= t && (this.__redo__[i] = ++e)
            }
            ), this),
            this.__redo__.push(t)) : _(this, "__redo__", h("c", [t])))
        }
        )),
        _onDelete: h((function(t) {
            var i;
            t >= this.__nextIndex__ || (--this.__nextIndex__,
            this.__redo__ && (-1 !== (i = this.__redo__.indexOf(t)) && this.__redo__.splice(i, 1),
            this.__redo__.forEach((function(e, r) {
                e > t && (this.__redo__[r] = --e)
            }
            ), this)))
        }
        )),
        _onClear: h((function() {
            this.__redo__ && o.call(this.__redo__),
            this.__nextIndex__ = 0
        }
        ))
    }))),
    _(n.prototype, y.iterator, h((function() {
        return this
    }
    )))
}
, function(t, e, r) {
    "use strict";
    var n = r(517);
    t.exports = function(t, e) {
        var r;
        function o(n) {
            e.rejectUnauthorized && t.emit("error", n),
            r.end()
        }
        return e.port = e.port || 8883,
        e.host = e.hostname || e.host || "localhost",
        e.rejectUnauthorized = !1 !== e.rejectUnauthorized,
        delete e.path,
        (r = n.connect(e)).on("secureConnect", (function() {
            e.rejectUnauthorized && !r.authorized ? r.emit("error", new Error("TLS not authorized")) : r.removeListener("error", o)
        }
        )),
        r.on("error", o),
        r
    }
}
, function(t, e, r) {
    (function(e, n) {
        var o = r(390)
          , c = r(518)
          , l = r(384)
          , f = r(521)
          , h = e.from && e.from !== Uint8Array.from ? e.from([0]) : new e([0])
          , d = function(t, e) {
            t._corked ? t.once("uncork", e) : e()
        }
          , y = function(t, e) {
            return function(r) {
                r ? function(t, e) {
                    t._autoDestroy && t.destroy(e)
                }(t, "premature close" === r.message ? null : r) : e && !t._ended && t.end()
            }
        }
          , _ = function(t, e, r) {
            if (!(this instanceof _))
                return new _(t,e,r);
            o.Duplex.call(this, r),
            this._writable = null,
            this._readable = null,
            this._readable2 = null,
            this._autoDestroy = !r || !1 !== r.autoDestroy,
            this._forwardDestroy = !r || !1 !== r.destroy,
            this._forwardEnd = !r || !1 !== r.end,
            this._corked = 1,
            this._ondrain = null,
            this._drained = !1,
            this._forwarding = !1,
            this._unwrite = null,
            this._unread = null,
            this._ended = !1,
            this.destroyed = !1,
            t && this.setWritable(t),
            e && this.setReadable(e)
        };
        l(_, o.Duplex),
        _.obj = function(t, e, r) {
            return r || (r = {}),
            r.objectMode = !0,
            r.highWaterMark = 16,
            new _(t,e,r)
        }
        ,
        _.prototype.cork = function() {
            1 == ++this._corked && this.emit("cork")
        }
        ,
        _.prototype.uncork = function() {
            this._corked && 0 == --this._corked && this.emit("uncork")
        }
        ,
        _.prototype.setWritable = function(t) {
            if (this._unwrite && this._unwrite(),
            this.destroyed)
                t && t.destroy && t.destroy();
            else if (null !== t && !1 !== t) {
                var e = this
                  , r = c(t, {
                    writable: !0,
                    readable: !1
                }, y(this, this._forwardEnd))
                  , o = function() {
                    var t = e._ondrain;
                    e._ondrain = null,
                    t && t()
                };
                this._unwrite && n.nextTick(o),
                this._writable = t,
                this._writable.on("drain", o),
                this._unwrite = function() {
                    e._writable.removeListener("drain", o),
                    r()
                }
                ,
                this.uncork()
            } else
                this.end()
        }
        ,
        _.prototype.setReadable = function(t) {
            if (this._unread && this._unread(),
            this.destroyed)
                t && t.destroy && t.destroy();
            else {
                if (null === t || !1 === t)
                    return this.push(null),
                    void this.resume();
                var e, r = this, n = c(t, {
                    writable: !1,
                    readable: !0
                }, y(this)), l = function() {
                    r._forward()
                }, f = function() {
                    r.push(null)
                };
                this._drained = !0,
                this._readable = t,
                this._readable2 = t._readableState ? t : (e = t,
                new o.Readable({
                    objectMode: !0,
                    highWaterMark: 16
                }).wrap(e)),
                this._readable2.on("readable", l),
                this._readable2.on("end", f),
                this._unread = function() {
                    r._readable2.removeListener("readable", l),
                    r._readable2.removeListener("end", f),
                    n()
                }
                ,
                this._forward()
            }
        }
        ,
        _.prototype._read = function() {
            this._drained = !0,
            this._forward()
        }
        ,
        _.prototype._forward = function() {
            if (!this._forwarding && this._readable2 && this._drained) {
                var data;
                for (this._forwarding = !0; this._drained && null !== (data = f(this._readable2)); )
                    this.destroyed || (this._drained = this.push(data));
                this._forwarding = !1
            }
        }
        ,
        _.prototype.destroy = function(t) {
            if (!this.destroyed) {
                this.destroyed = !0;
                var e = this;
                n.nextTick((function() {
                    e._destroy(t)
                }
                ))
            }
        }
        ,
        _.prototype._destroy = function(t) {
            if (t) {
                var e = this._ondrain;
                this._ondrain = null,
                e ? e(t) : this.emit("error", t)
            }
            this._forwardDestroy && (this._readable && this._readable.destroy && this._readable.destroy(),
            this._writable && this._writable.destroy && this._writable.destroy()),
            this.emit("close")
        }
        ,
        _.prototype._write = function(data, t, e) {
            return this.destroyed ? e() : this._corked ? d(this, this._write.bind(this, data, t, e)) : data === h ? this._finish(e) : this._writable ? void (!1 === this._writable.write(data) ? this._ondrain = e : e()) : e()
        }
        ,
        _.prototype._finish = function(t) {
            var e = this;
            this.emit("preend"),
            d(this, (function() {
                var r, n;
                r = e._forwardEnd && e._writable,
                n = function() {
                    !1 === e._writableState.prefinished && (e._writableState.prefinished = !0),
                    e.emit("prefinish"),
                    d(e, t)
                }
                ,
                r ? r._writableState && r._writableState.finished ? n() : r._writableState ? r.end(n) : (r.end(),
                n()) : n()
            }
            ))
        }
        ,
        _.prototype.end = function(data, t, e) {
            return "function" == typeof data ? this.end(null, null, data) : "function" == typeof t ? this.end(data, null, t) : (this._ended = !0,
            data && this.write(data),
            this._writableState.ending || this.write(h),
            o.Writable.prototype.end.call(this, e))
        }
        ,
        t.exports = _
    }
    ).call(this, r(391).Buffer, r(147))
}
, function(t, e, r) {
    "use strict";
    (function(e) {
        var n = r(401)
          , o = r(390).Readable
          , c = {
            objectMode: !0
        }
          , l = {
            clean: !0
        }
          , f = r(442);
        function h(t) {
            if (!(this instanceof h))
                return new h(t);
            this.options = t || {},
            this.options = n(l, t),
            this._inflights = new f
        }
        h.prototype.put = function(t, e) {
            return this._inflights.set(t.messageId, t),
            e && e(),
            this
        }
        ,
        h.prototype.createStream = function() {
            var t = new o(c)
              , r = !1
              , n = []
              , i = 0;
            return this._inflights.forEach((function(t, e) {
                n.push(t)
            }
            )),
            t._read = function() {
                !r && i < n.length ? this.push(n[i++]) : this.push(null)
            }
            ,
            t.destroy = function() {
                if (!r) {
                    var t = this;
                    r = !0,
                    e.nextTick((function() {
                        t.emit("close")
                    }
                    ))
                }
            }
            ,
            t
        }
        ,
        h.prototype.del = function(t, e) {
            return (t = this._inflights.get(t.messageId)) ? (this._inflights.delete(t.messageId),
            e(null, t)) : e && e(new Error("missing packet")),
            this
        }
        ,
        h.prototype.get = function(t, e) {
            return (t = this._inflights.get(t.messageId)) ? e(null, t) : e && e(new Error("missing packet")),
            this
        }
        ,
        h.prototype.close = function(t) {
            this.options.clean && (this._inflights = null),
            t && t()
        }
        ,
        t.exports = h
    }
    ).call(this, r(147))
}
, function(t, e, r) {
    "use strict";
    (function(e, n) {
        var o = r(395);
        t.exports = I;
        var c, l = r(410);
        I.ReadableState = x;
        r(394).EventEmitter;
        var f = function(t, e) {
            return t.listeners(e).length
        }
          , h = r(411)
          , d = r(402).Buffer
          , y = e.Uint8Array || function() {}
        ;
        var _ = Object.create(r(396));
        _.inherits = r(384);
        var m = r(437)
          , v = void 0;
        v = m && m.debuglog ? m.debuglog("stream") : function() {}
        ;
        var w, S = r(438), E = r(413);
        _.inherits(I, h);
        var k = ["error", "close", "destroy", "pause", "resume"];
        function x(t, e) {
            t = t || {};
            var n = e instanceof (c = c || r(387));
            this.objectMode = !!t.objectMode,
            n && (this.objectMode = this.objectMode || !!t.readableObjectMode);
            var o = t.highWaterMark
              , l = t.readableHighWaterMark
              , f = this.objectMode ? 16 : 16384;
            this.highWaterMark = o || 0 === o ? o : n && (l || 0 === l) ? l : f,
            this.highWaterMark = Math.floor(this.highWaterMark),
            this.buffer = new S,
            this.length = 0,
            this.pipes = null,
            this.pipesCount = 0,
            this.flowing = null,
            this.ended = !1,
            this.endEmitted = !1,
            this.reading = !1,
            this.sync = !0,
            this.needReadable = !1,
            this.emittedReadable = !1,
            this.readableListening = !1,
            this.resumeScheduled = !1,
            this.destroyed = !1,
            this.defaultEncoding = t.defaultEncoding || "utf8",
            this.awaitDrain = 0,
            this.readingMore = !1,
            this.decoder = null,
            this.encoding = null,
            t.encoding && (w || (w = r(415).StringDecoder),
            this.decoder = new w(t.encoding),
            this.encoding = t.encoding)
        }
        function I(t) {
            if (c = c || r(387),
            !(this instanceof I))
                return new I(t);
            this._readableState = new x(t,this),
            this.readable = !0,
            t && ("function" == typeof t.read && (this._read = t.read),
            "function" == typeof t.destroy && (this._destroy = t.destroy)),
            h.call(this)
        }
        function O(t, e, r, n, o) {
            var c, l = t._readableState;
            null === e ? (l.reading = !1,
            function(t, e) {
                if (e.ended)
                    return;
                if (e.decoder) {
                    var r = e.decoder.end();
                    r && r.length && (e.buffer.push(r),
                    e.length += e.objectMode ? 1 : r.length)
                }
                e.ended = !0,
                P(t)
            }(t, l)) : (o || (c = function(t, e) {
                var r;
                n = e,
                d.isBuffer(n) || n instanceof y || "string" == typeof e || void 0 === e || t.objectMode || (r = new TypeError("Invalid non-string/buffer chunk"));
                var n;
                return r
            }(l, e)),
            c ? t.emit("error", c) : l.objectMode || e && e.length > 0 ? ("string" == typeof e || l.objectMode || Object.getPrototypeOf(e) === d.prototype || (e = function(t) {
                return d.from(t)
            }(e)),
            n ? l.endEmitted ? t.emit("error", new Error("stream.unshift() after end event")) : C(t, l, e, !0) : l.ended ? t.emit("error", new Error("stream.push() after EOF")) : (l.reading = !1,
            l.decoder && !r ? (e = l.decoder.write(e),
            l.objectMode || 0 !== e.length ? C(t, l, e, !1) : j(t, l)) : C(t, l, e, !1))) : n || (l.reading = !1));
            return function(t) {
                return !t.ended && (t.needReadable || t.length < t.highWaterMark || 0 === t.length)
            }(l)
        }
        function C(t, e, r, n) {
            e.flowing && 0 === e.length && !e.sync ? (t.emit("data", r),
            t.read(0)) : (e.length += e.objectMode ? 1 : r.length,
            n ? e.buffer.unshift(r) : e.buffer.push(r),
            e.needReadable && P(t)),
            j(t, e)
        }
        Object.defineProperty(I.prototype, "destroyed", {
            get: function() {
                return void 0 !== this._readableState && this._readableState.destroyed
            },
            set: function(t) {
                this._readableState && (this._readableState.destroyed = t)
            }
        }),
        I.prototype.destroy = E.destroy,
        I.prototype._undestroy = E.undestroy,
        I.prototype._destroy = function(t, e) {
            this.push(null),
            e(t)
        }
        ,
        I.prototype.push = function(t, e) {
            var r, n = this._readableState;
            return n.objectMode ? r = !0 : "string" == typeof t && ((e = e || n.defaultEncoding) !== n.encoding && (t = d.from(t, e),
            e = ""),
            r = !0),
            O(this, t, e, !1, r)
        }
        ,
        I.prototype.unshift = function(t) {
            return O(this, t, null, !0, !1)
        }
        ,
        I.prototype.isPaused = function() {
            return !1 === this._readableState.flowing
        }
        ,
        I.prototype.setEncoding = function(t) {
            return w || (w = r(415).StringDecoder),
            this._readableState.decoder = new w(t),
            this._readableState.encoding = t,
            this
        }
        ;
        function A(t, e) {
            return t <= 0 || 0 === e.length && e.ended ? 0 : e.objectMode ? 1 : t != t ? e.flowing && e.length ? e.buffer.head.data.length : e.length : (t > e.highWaterMark && (e.highWaterMark = function(t) {
                return t >= 8388608 ? t = 8388608 : (t--,
                t |= t >>> 1,
                t |= t >>> 2,
                t |= t >>> 4,
                t |= t >>> 8,
                t |= t >>> 16,
                t++),
                t
            }(t)),
            t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0,
            0))
        }
        function P(t) {
            var e = t._readableState;
            e.needReadable = !1,
            e.emittedReadable || (v("emitReadable", e.flowing),
            e.emittedReadable = !0,
            e.sync ? o.nextTick(T, t) : T(t))
        }
        function T(t) {
            v("emit readable"),
            t.emit("readable"),
            N(t)
        }
        function j(t, e) {
            e.readingMore || (e.readingMore = !0,
            o.nextTick(R, t, e))
        }
        function R(t, e) {
            for (var r = e.length; !e.reading && !e.flowing && !e.ended && e.length < e.highWaterMark && (v("maybeReadMore read 0"),
            t.read(0),
            r !== e.length); )
                r = e.length;
            e.readingMore = !1
        }
        function M(t) {
            v("readable nexttick read 0"),
            t.read(0)
        }
        function B(t, e) {
            e.reading || (v("resume read 0"),
            t.read(0)),
            e.resumeScheduled = !1,
            e.awaitDrain = 0,
            t.emit("resume"),
            N(t),
            e.flowing && !e.reading && t.read(0)
        }
        function N(t) {
            var e = t._readableState;
            for (v("flow", e.flowing); e.flowing && null !== t.read(); )
                ;
        }
        function U(t, e) {
            return 0 === e.length ? null : (e.objectMode ? r = e.buffer.shift() : !t || t >= e.length ? (r = e.decoder ? e.buffer.join("") : 1 === e.buffer.length ? e.buffer.head.data : e.buffer.concat(e.length),
            e.buffer.clear()) : r = function(t, e, r) {
                var n;
                t < e.head.data.length ? (n = e.head.data.slice(0, t),
                e.head.data = e.head.data.slice(t)) : n = t === e.head.data.length ? e.shift() : r ? function(t, e) {
                    var p = e.head
                      , r = 1
                      , n = p.data;
                    t -= n.length;
                    for (; p = p.next; ) {
                        var o = p.data
                          , c = t > o.length ? o.length : t;
                        if (c === o.length ? n += o : n += o.slice(0, t),
                        0 === (t -= c)) {
                            c === o.length ? (++r,
                            p.next ? e.head = p.next : e.head = e.tail = null) : (e.head = p,
                            p.data = o.slice(c));
                            break
                        }
                        ++r
                    }
                    return e.length -= r,
                    n
                }(t, e) : function(t, e) {
                    var r = d.allocUnsafe(t)
                      , p = e.head
                      , n = 1;
                    p.data.copy(r),
                    t -= p.data.length;
                    for (; p = p.next; ) {
                        var o = p.data
                          , c = t > o.length ? o.length : t;
                        if (o.copy(r, r.length - t, 0, c),
                        0 === (t -= c)) {
                            c === o.length ? (++n,
                            p.next ? e.head = p.next : e.head = e.tail = null) : (e.head = p,
                            p.data = o.slice(c));
                            break
                        }
                        ++n
                    }
                    return e.length -= n,
                    r
                }(t, e);
                return n
            }(t, e.buffer, e.decoder),
            r);
            var r
        }
        function L(t) {
            var e = t._readableState;
            if (e.length > 0)
                throw new Error('"endReadable()" called on non-empty stream');
            e.endEmitted || (e.ended = !0,
            o.nextTick(D, e, t))
        }
        function D(t, e) {
            t.endEmitted || 0 !== t.length || (t.endEmitted = !0,
            e.readable = !1,
            e.emit("end"))
        }
        function F(t, e) {
            for (var i = 0, r = t.length; i < r; i++)
                if (t[i] === e)
                    return i;
            return -1
        }
        I.prototype.read = function(t) {
            v("read", t),
            t = parseInt(t, 10);
            var e = this._readableState
              , r = t;
            if (0 !== t && (e.emittedReadable = !1),
            0 === t && e.needReadable && (e.length >= e.highWaterMark || e.ended))
                return v("read: emitReadable", e.length, e.ended),
                0 === e.length && e.ended ? L(this) : P(this),
                null;
            if (0 === (t = A(t, e)) && e.ended)
                return 0 === e.length && L(this),
                null;
            var n, o = e.needReadable;
            return v("need readable", o),
            (0 === e.length || e.length - t < e.highWaterMark) && v("length less than watermark", o = !0),
            e.ended || e.reading ? v("reading or ended", o = !1) : o && (v("do read"),
            e.reading = !0,
            e.sync = !0,
            0 === e.length && (e.needReadable = !0),
            this._read(e.highWaterMark),
            e.sync = !1,
            e.reading || (t = A(r, e))),
            null === (n = t > 0 ? U(t, e) : null) ? (e.needReadable = !0,
            t = 0) : e.length -= t,
            0 === e.length && (e.ended || (e.needReadable = !0),
            r !== t && e.ended && L(this)),
            null !== n && this.emit("data", n),
            n
        }
        ,
        I.prototype._read = function(t) {
            this.emit("error", new Error("_read() is not implemented"))
        }
        ,
        I.prototype.pipe = function(t, e) {
            var r = this
              , c = this._readableState;
            switch (c.pipesCount) {
            case 0:
                c.pipes = t;
                break;
            case 1:
                c.pipes = [c.pipes, t];
                break;
            default:
                c.pipes.push(t)
            }
            c.pipesCount += 1,
            v("pipe count=%d opts=%j", c.pipesCount, e);
            var h = (!e || !1 !== e.end) && t !== n.stdout && t !== n.stderr ? y : I;
            function d(e, n) {
                v("onunpipe"),
                e === r && n && !1 === n.hasUnpiped && (n.hasUnpiped = !0,
                v("cleanup"),
                t.removeListener("close", k),
                t.removeListener("finish", x),
                t.removeListener("drain", _),
                t.removeListener("error", E),
                t.removeListener("unpipe", d),
                r.removeListener("end", y),
                r.removeListener("end", I),
                r.removeListener("data", S),
                m = !0,
                !c.awaitDrain || t._writableState && !t._writableState.needDrain || _())
            }
            function y() {
                v("onend"),
                t.end()
            }
            c.endEmitted ? o.nextTick(h) : r.once("end", h),
            t.on("unpipe", d);
            var _ = function(t) {
                return function() {
                    var e = t._readableState;
                    v("pipeOnDrain", e.awaitDrain),
                    e.awaitDrain && e.awaitDrain--,
                    0 === e.awaitDrain && f(t, "data") && (e.flowing = !0,
                    N(t))
                }
            }(r);
            t.on("drain", _);
            var m = !1;
            var w = !1;
            function S(e) {
                v("ondata"),
                w = !1,
                !1 !== t.write(e) || w || ((1 === c.pipesCount && c.pipes === t || c.pipesCount > 1 && -1 !== F(c.pipes, t)) && !m && (v("false write response, pause", r._readableState.awaitDrain),
                r._readableState.awaitDrain++,
                w = !0),
                r.pause())
            }
            function E(e) {
                v("onerror", e),
                I(),
                t.removeListener("error", E),
                0 === f(t, "error") && t.emit("error", e)
            }
            function k() {
                t.removeListener("finish", x),
                I()
            }
            function x() {
                v("onfinish"),
                t.removeListener("close", k),
                I()
            }
            function I() {
                v("unpipe"),
                r.unpipe(t)
            }
            return r.on("data", S),
            function(t, e, r) {
                if ("function" == typeof t.prependListener)
                    return t.prependListener(e, r);
                t._events && t._events[e] ? l(t._events[e]) ? t._events[e].unshift(r) : t._events[e] = [r, t._events[e]] : t.on(e, r)
            }(t, "error", E),
            t.once("close", k),
            t.once("finish", x),
            t.emit("pipe", r),
            c.flowing || (v("pipe resume"),
            r.resume()),
            t
        }
        ,
        I.prototype.unpipe = function(t) {
            var e = this._readableState
              , r = {
                hasUnpiped: !1
            };
            if (0 === e.pipesCount)
                return this;
            if (1 === e.pipesCount)
                return t && t !== e.pipes || (t || (t = e.pipes),
                e.pipes = null,
                e.pipesCount = 0,
                e.flowing = !1,
                t && t.emit("unpipe", this, r)),
                this;
            if (!t) {
                var n = e.pipes
                  , o = e.pipesCount;
                e.pipes = null,
                e.pipesCount = 0,
                e.flowing = !1;
                for (var i = 0; i < o; i++)
                    n[i].emit("unpipe", this, r);
                return this
            }
            var c = F(e.pipes, t);
            return -1 === c || (e.pipes.splice(c, 1),
            e.pipesCount -= 1,
            1 === e.pipesCount && (e.pipes = e.pipes[0]),
            t.emit("unpipe", this, r)),
            this
        }
        ,
        I.prototype.on = function(t, e) {
            var r = h.prototype.on.call(this, t, e);
            if ("data" === t)
                !1 !== this._readableState.flowing && this.resume();
            else if ("readable" === t) {
                var n = this._readableState;
                n.endEmitted || n.readableListening || (n.readableListening = n.needReadable = !0,
                n.emittedReadable = !1,
                n.reading ? n.length && P(this) : o.nextTick(M, this))
            }
            return r
        }
        ,
        I.prototype.addListener = I.prototype.on,
        I.prototype.resume = function() {
            var t = this._readableState;
            return t.flowing || (v("resume"),
            t.flowing = !0,
            function(t, e) {
                e.resumeScheduled || (e.resumeScheduled = !0,
                o.nextTick(B, t, e))
            }(this, t)),
            this
        }
        ,
        I.prototype.pause = function() {
            return v("call pause flowing=%j", this._readableState.flowing),
            !1 !== this._readableState.flowing && (v("pause"),
            this._readableState.flowing = !1,
            this.emit("pause")),
            this
        }
        ,
        I.prototype.wrap = function(t) {
            var e = this
              , r = this._readableState
              , n = !1;
            for (var i in t.on("end", (function() {
                if (v("wrapped end"),
                r.decoder && !r.ended) {
                    var t = r.decoder.end();
                    t && t.length && e.push(t)
                }
                e.push(null)
            }
            )),
            t.on("data", (function(o) {
                (v("wrapped data"),
                r.decoder && (o = r.decoder.write(o)),
                r.objectMode && null == o) || (r.objectMode || o && o.length) && (e.push(o) || (n = !0,
                t.pause()))
            }
            )),
            t)
                void 0 === this[i] && "function" == typeof t[i] && (this[i] = function(e) {
                    return function() {
                        return t[e].apply(t, arguments)
                    }
                }(i));
            for (var o = 0; o < k.length; o++)
                t.on(k[o], this.emit.bind(this, k[o]));
            return this._read = function(e) {
                v("wrapped _read", e),
                n && (n = !1,
                t.resume())
            }
            ,
            this
        }
        ,
        Object.defineProperty(I.prototype, "readableHighWaterMark", {
            enumerable: !1,
            get: function() {
                return this._readableState.highWaterMark
            }
        }),
        I._fromList = U
    }
    ).call(this, r(29), r(147))
}
, function(t, e) {
    var r = {}.toString;
    t.exports = Array.isArray || function(t) {
        return "[object Array]" == r.call(t)
    }
}
, function(t, e, r) {
    t.exports = r(394).EventEmitter
}
, function(t, e, r) {
    "use strict";
    e.byteLength = function(t) {
        var e = f(t)
          , r = e[0]
          , n = e[1];
        return 3 * (r + n) / 4 - n
    }
    ,
    e.toByteArray = function(t) {
        var e, i, r = f(t), n = r[0], l = r[1], h = new c(function(t, e, r) {
            return 3 * (e + r) / 4 - r
        }(0, n, l)), d = 0, y = l > 0 ? n - 4 : n;
        for (i = 0; i < y; i += 4)
            e = o[t.charCodeAt(i)] << 18 | o[t.charCodeAt(i + 1)] << 12 | o[t.charCodeAt(i + 2)] << 6 | o[t.charCodeAt(i + 3)],
            h[d++] = e >> 16 & 255,
            h[d++] = e >> 8 & 255,
            h[d++] = 255 & e;
        2 === l && (e = o[t.charCodeAt(i)] << 2 | o[t.charCodeAt(i + 1)] >> 4,
        h[d++] = 255 & e);
        1 === l && (e = o[t.charCodeAt(i)] << 10 | o[t.charCodeAt(i + 1)] << 4 | o[t.charCodeAt(i + 2)] >> 2,
        h[d++] = e >> 8 & 255,
        h[d++] = 255 & e);
        return h
    }
    ,
    e.fromByteArray = function(t) {
        for (var e, r = t.length, o = r % 3, c = [], i = 0, l = r - o; i < l; i += 16383)
            c.push(h(t, i, i + 16383 > l ? l : i + 16383));
        1 === o ? (e = t[r - 1],
        c.push(n[e >> 2] + n[e << 4 & 63] + "==")) : 2 === o && (e = (t[r - 2] << 8) + t[r - 1],
        c.push(n[e >> 10] + n[e >> 4 & 63] + n[e << 2 & 63] + "="));
        return c.join("")
    }
    ;
    for (var n = [], o = [], c = "undefined" != typeof Uint8Array ? Uint8Array : Array, code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = 0, l = code.length; i < l; ++i)
        n[i] = code[i],
        o[code.charCodeAt(i)] = i;
    function f(t) {
        var e = t.length;
        if (e % 4 > 0)
            throw new Error("Invalid string. Length must be a multiple of 4");
        var r = t.indexOf("=");
        return -1 === r && (r = e),
        [r, r === e ? 0 : 4 - r % 4]
    }
    function h(t, e, r) {
        for (var o, c, output = [], i = e; i < r; i += 3)
            o = (t[i] << 16 & 16711680) + (t[i + 1] << 8 & 65280) + (255 & t[i + 2]),
            output.push(n[(c = o) >> 18 & 63] + n[c >> 12 & 63] + n[c >> 6 & 63] + n[63 & c]);
        return output.join("")
    }
    o["-".charCodeAt(0)] = 62,
    o["_".charCodeAt(0)] = 63
}
, function(t, e, r) {
    "use strict";
    var n = r(395);
    function o(t, e) {
        t.emit("error", e)
    }
    t.exports = {
        destroy: function(t, e) {
            var r = this
              , c = this._readableState && this._readableState.destroyed
              , l = this._writableState && this._writableState.destroyed;
            return c || l ? (e ? e(t) : !t || this._writableState && this._writableState.errorEmitted || n.nextTick(o, this, t),
            this) : (this._readableState && (this._readableState.destroyed = !0),
            this._writableState && (this._writableState.destroyed = !0),
            this._destroy(t || null, (function(t) {
                !e && t ? (n.nextTick(o, r, t),
                r._writableState && (r._writableState.errorEmitted = !0)) : e && e(t)
            }
            )),
            this)
        },
        undestroy: function() {
            this._readableState && (this._readableState.destroyed = !1,
            this._readableState.reading = !1,
            this._readableState.ended = !1,
            this._readableState.endEmitted = !1),
            this._writableState && (this._writableState.destroyed = !1,
            this._writableState.ended = !1,
            this._writableState.ending = !1,
            this._writableState.finished = !1,
            this._writableState.errorEmitted = !1)
        }
    }
}
, function(t, e, r) {
    "use strict";
    (function(e) {
        var n = r(395);
        function o(t) {
            var e = this;
            this.next = null,
            this.entry = null,
            this.finish = function() {
                !function(t, e, r) {
                    var n = t.entry;
                    t.entry = null;
                    for (; n; ) {
                        var o = n.callback;
                        e.pendingcb--,
                        o(r),
                        n = n.next
                    }
                    e.corkedRequestsFree ? e.corkedRequestsFree.next = t : e.corkedRequestsFree = t
                }(e, t)
            }
        }
        t.exports = E;
        var c, l = n.nextTick;
        E.WritableState = S;
        var f = Object.create(r(396));
        f.inherits = r(384);
        var h = {
            deprecate: r(440)
        }
          , d = r(411)
          , y = r(402).Buffer
          , _ = e.Uint8Array || function() {}
        ;
        var m, v = r(413);
        function w() {}
        function S(t, e) {
            c = c || r(387),
            t = t || {};
            var f = e instanceof c;
            this.objectMode = !!t.objectMode,
            f && (this.objectMode = this.objectMode || !!t.writableObjectMode);
            var h = t.highWaterMark
              , d = t.writableHighWaterMark
              , y = this.objectMode ? 16 : 16384;
            this.highWaterMark = h || 0 === h ? h : f && (d || 0 === d) ? d : y,
            this.highWaterMark = Math.floor(this.highWaterMark),
            this.finalCalled = !1,
            this.needDrain = !1,
            this.ending = !1,
            this.ended = !1,
            this.finished = !1,
            this.destroyed = !1;
            var _ = !1 === t.decodeStrings;
            this.decodeStrings = !_,
            this.defaultEncoding = t.defaultEncoding || "utf8",
            this.length = 0,
            this.writing = !1,
            this.corked = 0,
            this.sync = !0,
            this.bufferProcessing = !1,
            this.onwrite = function(t) {
                !function(t, e) {
                    var r = t._writableState
                      , o = r.sync
                      , c = r.writecb;
                    if (function(t) {
                        t.writing = !1,
                        t.writecb = null,
                        t.length -= t.writelen,
                        t.writelen = 0
                    }(r),
                    e)
                        !function(t, e, r, o, c) {
                            --e.pendingcb,
                            r ? (n.nextTick(c, o),
                            n.nextTick(A, t, e),
                            t._writableState.errorEmitted = !0,
                            t.emit("error", o)) : (c(o),
                            t._writableState.errorEmitted = !0,
                            t.emit("error", o),
                            A(t, e))
                        }(t, r, o, e, c);
                    else {
                        var f = O(r);
                        f || r.corked || r.bufferProcessing || !r.bufferedRequest || I(t, r),
                        o ? l(x, t, r, f, c) : x(t, r, f, c)
                    }
                }(e, t)
            }
            ,
            this.writecb = null,
            this.writelen = 0,
            this.bufferedRequest = null,
            this.lastBufferedRequest = null,
            this.pendingcb = 0,
            this.prefinished = !1,
            this.errorEmitted = !1,
            this.bufferedRequestCount = 0,
            this.corkedRequestsFree = new o(this)
        }
        function E(t) {
            if (c = c || r(387),
            !(m.call(E, this) || this instanceof c))
                return new E(t);
            this._writableState = new S(t,this),
            this.writable = !0,
            t && ("function" == typeof t.write && (this._write = t.write),
            "function" == typeof t.writev && (this._writev = t.writev),
            "function" == typeof t.destroy && (this._destroy = t.destroy),
            "function" == typeof t.final && (this._final = t.final)),
            d.call(this)
        }
        function k(t, e, r, n, o, c, l) {
            e.writelen = n,
            e.writecb = l,
            e.writing = !0,
            e.sync = !0,
            r ? t._writev(o, e.onwrite) : t._write(o, c, e.onwrite),
            e.sync = !1
        }
        function x(t, e, r, n) {
            r || function(t, e) {
                0 === e.length && e.needDrain && (e.needDrain = !1,
                t.emit("drain"))
            }(t, e),
            e.pendingcb--,
            n(),
            A(t, e)
        }
        function I(t, e) {
            e.bufferProcessing = !0;
            var r = e.bufferedRequest;
            if (t._writev && r && r.next) {
                var n = e.bufferedRequestCount
                  , c = new Array(n)
                  , l = e.corkedRequestsFree;
                l.entry = r;
                for (var f = 0, h = !0; r; )
                    c[f] = r,
                    r.isBuf || (h = !1),
                    r = r.next,
                    f += 1;
                c.allBuffers = h,
                k(t, e, !0, e.length, c, "", l.finish),
                e.pendingcb++,
                e.lastBufferedRequest = null,
                l.next ? (e.corkedRequestsFree = l.next,
                l.next = null) : e.corkedRequestsFree = new o(e),
                e.bufferedRequestCount = 0
            } else {
                for (; r; ) {
                    var d = r.chunk
                      , y = r.encoding
                      , _ = r.callback;
                    if (k(t, e, !1, e.objectMode ? 1 : d.length, d, y, _),
                    r = r.next,
                    e.bufferedRequestCount--,
                    e.writing)
                        break
                }
                null === r && (e.lastBufferedRequest = null)
            }
            e.bufferedRequest = r,
            e.bufferProcessing = !1
        }
        function O(t) {
            return t.ending && 0 === t.length && null === t.bufferedRequest && !t.finished && !t.writing
        }
        function C(t, e) {
            t._final((function(r) {
                e.pendingcb--,
                r && t.emit("error", r),
                e.prefinished = !0,
                t.emit("prefinish"),
                A(t, e)
            }
            ))
        }
        function A(t, e) {
            var r = O(e);
            return r && (!function(t, e) {
                e.prefinished || e.finalCalled || ("function" == typeof t._final ? (e.pendingcb++,
                e.finalCalled = !0,
                n.nextTick(C, t, e)) : (e.prefinished = !0,
                t.emit("prefinish")))
            }(t, e),
            0 === e.pendingcb && (e.finished = !0,
            t.emit("finish"))),
            r
        }
        f.inherits(E, d),
        S.prototype.getBuffer = function() {
            for (var t = this.bufferedRequest, e = []; t; )
                e.push(t),
                t = t.next;
            return e
        }
        ,
        function() {
            try {
                Object.defineProperty(S.prototype, "buffer", {
                    get: h.deprecate((function() {
                        return this.getBuffer()
                    }
                    ), "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
                })
            } catch (t) {}
        }(),
        "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (m = Function.prototype[Symbol.hasInstance],
        Object.defineProperty(E, Symbol.hasInstance, {
            value: function(object) {
                return !!m.call(this, object) || this === E && (object && object._writableState instanceof S)
            }
        })) : m = function(object) {
            return object instanceof this
        }
        ,
        E.prototype.pipe = function() {
            this.emit("error", new Error("Cannot pipe, not readable"))
        }
        ,
        E.prototype.write = function(t, e, r) {
            var o, c = this._writableState, l = !1, f = !c.objectMode && (o = t,
            y.isBuffer(o) || o instanceof _);
            return f && !y.isBuffer(t) && (t = function(t) {
                return y.from(t)
            }(t)),
            "function" == typeof e && (r = e,
            e = null),
            f ? e = "buffer" : e || (e = c.defaultEncoding),
            "function" != typeof r && (r = w),
            c.ended ? function(t, e) {
                var r = new Error("write after end");
                t.emit("error", r),
                n.nextTick(e, r)
            }(this, r) : (f || function(t, e, r, o) {
                var c = !0
                  , l = !1;
                return null === r ? l = new TypeError("May not write null values to stream") : "string" == typeof r || void 0 === r || e.objectMode || (l = new TypeError("Invalid non-string/buffer chunk")),
                l && (t.emit("error", l),
                n.nextTick(o, l),
                c = !1),
                c
            }(this, c, t, r)) && (c.pendingcb++,
            l = function(t, e, r, n, o, c) {
                if (!r) {
                    var l = function(t, e, r) {
                        t.objectMode || !1 === t.decodeStrings || "string" != typeof e || (e = y.from(e, r));
                        return e
                    }(e, n, o);
                    n !== l && (r = !0,
                    o = "buffer",
                    n = l)
                }
                var f = e.objectMode ? 1 : n.length;
                e.length += f;
                var h = e.length < e.highWaterMark;
                h || (e.needDrain = !0);
                if (e.writing || e.corked) {
                    var d = e.lastBufferedRequest;
                    e.lastBufferedRequest = {
                        chunk: n,
                        encoding: o,
                        isBuf: r,
                        callback: c,
                        next: null
                    },
                    d ? d.next = e.lastBufferedRequest : e.bufferedRequest = e.lastBufferedRequest,
                    e.bufferedRequestCount += 1
                } else
                    k(t, e, !1, f, n, o, c);
                return h
            }(this, c, f, t, e, r)),
            l
        }
        ,
        E.prototype.cork = function() {
            this._writableState.corked++
        }
        ,
        E.prototype.uncork = function() {
            var t = this._writableState;
            t.corked && (t.corked--,
            t.writing || t.corked || t.finished || t.bufferProcessing || !t.bufferedRequest || I(this, t))
        }
        ,
        E.prototype.setDefaultEncoding = function(t) {
            if ("string" == typeof t && (t = t.toLowerCase()),
            !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((t + "").toLowerCase()) > -1))
                throw new TypeError("Unknown encoding: " + t);
            return this._writableState.defaultEncoding = t,
            this
        }
        ,
        Object.defineProperty(E.prototype, "writableHighWaterMark", {
            enumerable: !1,
            get: function() {
                return this._writableState.highWaterMark
            }
        }),
        E.prototype._write = function(t, e, r) {
            r(new Error("_write() is not implemented"))
        }
        ,
        E.prototype._writev = null,
        E.prototype.end = function(t, e, r) {
            var o = this._writableState;
            "function" == typeof t ? (r = t,
            t = null,
            e = null) : "function" == typeof e && (r = e,
            e = null),
            null != t && this.write(t, e),
            o.corked && (o.corked = 1,
            this.uncork()),
            o.ending || o.finished || function(t, e, r) {
                e.ending = !0,
                A(t, e),
                r && (e.finished ? n.nextTick(r) : t.once("finish", r));
                e.ended = !0,
                t.writable = !1
            }(this, o, r)
        }
        ,
        Object.defineProperty(E.prototype, "destroyed", {
            get: function() {
                return void 0 !== this._writableState && this._writableState.destroyed
            },
            set: function(t) {
                this._writableState && (this._writableState.destroyed = t)
            }
        }),
        E.prototype.destroy = v.destroy,
        E.prototype._undestroy = v.undestroy,
        E.prototype._destroy = function(t, e) {
            this.end(),
            e(t)
        }
    }
    ).call(this, r(29))
}
, function(t, e, r) {
    "use strict";
    var n = r(388).Buffer
      , o = n.isEncoding || function(t) {
        switch ((t = "" + t) && t.toLowerCase()) {
        case "hex":
        case "utf8":
        case "utf-8":
        case "ascii":
        case "binary":
        case "base64":
        case "ucs2":
        case "ucs-2":
        case "utf16le":
        case "utf-16le":
        case "raw":
            return !0;
        default:
            return !1
        }
    }
    ;
    function c(t) {
        var e;
        switch (this.encoding = function(t) {
            var e = function(t) {
                if (!t)
                    return "utf8";
                for (var e; ; )
                    switch (t) {
                    case "utf8":
                    case "utf-8":
                        return "utf8";
                    case "ucs2":
                    case "ucs-2":
                    case "utf16le":
                    case "utf-16le":
                        return "utf16le";
                    case "latin1":
                    case "binary":
                        return "latin1";
                    case "base64":
                    case "ascii":
                    case "hex":
                        return t;
                    default:
                        if (e)
                            return;
                        t = ("" + t).toLowerCase(),
                        e = !0
                    }
            }(t);
            if ("string" != typeof e && (n.isEncoding === o || !o(t)))
                throw new Error("Unknown encoding: " + t);
            return e || t
        }(t),
        this.encoding) {
        case "utf16le":
            this.text = h,
            this.end = d,
            e = 4;
            break;
        case "utf8":
            this.fillLast = f,
            e = 4;
            break;
        case "base64":
            this.text = y,
            this.end = _,
            e = 3;
            break;
        default:
            return this.write = m,
            void (this.end = v)
        }
        this.lastNeed = 0,
        this.lastTotal = 0,
        this.lastChar = n.allocUnsafe(e)
    }
    function l(t) {
        return t <= 127 ? 0 : t >> 5 == 6 ? 2 : t >> 4 == 14 ? 3 : t >> 3 == 30 ? 4 : t >> 6 == 2 ? -1 : -2
    }
    function f(t) {
        var p = this.lastTotal - this.lastNeed
          , e = function(t, e, p) {
            if (128 != (192 & e[0]))
                return t.lastNeed = 0,
                "?";
            if (t.lastNeed > 1 && e.length > 1) {
                if (128 != (192 & e[1]))
                    return t.lastNeed = 1,
                    "?";
                if (t.lastNeed > 2 && e.length > 2 && 128 != (192 & e[2]))
                    return t.lastNeed = 2,
                    "?"
            }
        }(this, t);
        return void 0 !== e ? e : this.lastNeed <= t.length ? (t.copy(this.lastChar, p, 0, this.lastNeed),
        this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (t.copy(this.lastChar, p, 0, t.length),
        void (this.lastNeed -= t.length))
    }
    function h(t, i) {
        if ((t.length - i) % 2 == 0) {
            var e = t.toString("utf16le", i);
            if (e) {
                var r = e.charCodeAt(e.length - 1);
                if (r >= 55296 && r <= 56319)
                    return this.lastNeed = 2,
                    this.lastTotal = 4,
                    this.lastChar[0] = t[t.length - 2],
                    this.lastChar[1] = t[t.length - 1],
                    e.slice(0, -1)
            }
            return e
        }
        return this.lastNeed = 1,
        this.lastTotal = 2,
        this.lastChar[0] = t[t.length - 1],
        t.toString("utf16le", i, t.length - 1)
    }
    function d(t) {
        var e = t && t.length ? this.write(t) : "";
        if (this.lastNeed) {
            var r = this.lastTotal - this.lastNeed;
            return e + this.lastChar.toString("utf16le", 0, r)
        }
        return e
    }
    function y(t, i) {
        var e = (t.length - i) % 3;
        return 0 === e ? t.toString("base64", i) : (this.lastNeed = 3 - e,
        this.lastTotal = 3,
        1 === e ? this.lastChar[0] = t[t.length - 1] : (this.lastChar[0] = t[t.length - 2],
        this.lastChar[1] = t[t.length - 1]),
        t.toString("base64", i, t.length - e))
    }
    function _(t) {
        var e = t && t.length ? this.write(t) : "";
        return this.lastNeed ? e + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : e
    }
    function m(t) {
        return t.toString(this.encoding)
    }
    function v(t) {
        return t && t.length ? this.write(t) : ""
    }
    e.StringDecoder = c,
    c.prototype.write = function(t) {
        if (0 === t.length)
            return "";
        var e, i;
        if (this.lastNeed) {
            if (void 0 === (e = this.fillLast(t)))
                return "";
            i = this.lastNeed,
            this.lastNeed = 0
        } else
            i = 0;
        return i < t.length ? e ? e + this.text(t, i) : this.text(t, i) : e || ""
    }
    ,
    c.prototype.end = function(t) {
        var e = t && t.length ? this.write(t) : "";
        return this.lastNeed ? e + "?" : e
    }
    ,
    c.prototype.text = function(t, i) {
        var e = function(t, e, i) {
            var r = e.length - 1;
            if (r < i)
                return 0;
            var n = l(e[r]);
            if (n >= 0)
                return n > 0 && (t.lastNeed = n - 1),
                n;
            if (--r < i || -2 === n)
                return 0;
            if ((n = l(e[r])) >= 0)
                return n > 0 && (t.lastNeed = n - 2),
                n;
            if (--r < i || -2 === n)
                return 0;
            if ((n = l(e[r])) >= 0)
                return n > 0 && (2 === n ? n = 0 : t.lastNeed = n - 3),
                n;
            return 0
        }(this, t, i);
        if (!this.lastNeed)
            return t.toString("utf8", i);
        this.lastTotal = e;
        var r = t.length - (e - this.lastNeed);
        return t.copy(this.lastChar, 0, r),
        t.toString("utf8", i, r)
    }
    ,
    c.prototype.fillLast = function(t) {
        if (this.lastNeed <= t.length)
            return t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed),
            this.lastChar.toString(this.encoding, 0, this.lastTotal);
        t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, t.length),
        this.lastNeed -= t.length
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = l;
    var n = r(387)
      , o = Object.create(r(396));
    function c(t, data) {
        var e = this._transformState;
        e.transforming = !1;
        var r = e.writecb;
        if (!r)
            return this.emit("error", new Error("write callback called multiple times"));
        e.writechunk = null,
        e.writecb = null,
        null != data && this.push(data),
        r(t);
        var n = this._readableState;
        n.reading = !1,
        (n.needReadable || n.length < n.highWaterMark) && this._read(n.highWaterMark)
    }
    function l(t) {
        if (!(this instanceof l))
            return new l(t);
        n.call(this, t),
        this._transformState = {
            afterTransform: c.bind(this),
            needTransform: !1,
            transforming: !1,
            writecb: null,
            writechunk: null,
            writeencoding: null
        },
        this._readableState.needReadable = !0,
        this._readableState.sync = !1,
        t && ("function" == typeof t.transform && (this._transform = t.transform),
        "function" == typeof t.flush && (this._flush = t.flush)),
        this.on("prefinish", f)
    }
    function f() {
        var t = this;
        "function" == typeof this._flush ? this._flush((function(e, data) {
            h(t, e, data)
        }
        )) : h(this, null, null)
    }
    function h(t, e, data) {
        if (e)
            return t.emit("error", e);
        if (null != data && t.push(data),
        t._writableState.length)
            throw new Error("Calling transform done when ws.length != 0");
        if (t._transformState.transforming)
            throw new Error("Calling transform done when still transforming");
        return t.push(null)
    }
    o.inherits = r(384),
    o.inherits(l, n),
    l.prototype.push = function(t, e) {
        return this._transformState.needTransform = !1,
        n.prototype.push.call(this, t, e)
    }
    ,
    l.prototype._transform = function(t, e, r) {
        throw new Error("_transform() is not implemented")
    }
    ,
    l.prototype._write = function(t, e, r) {
        var n = this._transformState;
        if (n.writecb = r,
        n.writechunk = t,
        n.writeencoding = e,
        !n.transforming) {
            var o = this._readableState;
            (n.needTransform || o.needReadable || o.length < o.highWaterMark) && this._read(o.highWaterMark)
        }
    }
    ,
    l.prototype._read = function(t) {
        var e = this._transformState;
        null !== e.writechunk && e.writecb && !e.transforming ? (e.transforming = !0,
        this._transform(e.writechunk, e.writeencoding, e.afterTransform)) : e.needTransform = !0
    }
    ,
    l.prototype._destroy = function(t, e) {
        var r = this;
        n.prototype._destroy.call(this, t, (function(t) {
            e(t),
            r.emit("close")
        }
        ))
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(385);
    t.exports = function() {
        return n(this).length = 0,
        this
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(450)
      , o = Math.max;
    t.exports = function(t) {
        return o(0, n(t))
    }
}
, function(t, e, r) {
    "use strict";
    var n = Object.create
      , o = Object.getPrototypeOf
      , c = {};
    t.exports = function() {
        var t = Object.setPrototypeOf
          , e = arguments[0] || n;
        return "function" == typeof t && o(t(e(null), c)) === c
    }
}
, function(t, e, r) {
    "use strict";
    var n, o = r(454), c = r(385), l = Object.prototype.isPrototypeOf, f = Object.defineProperty, h = {
        configurable: !0,
        enumerable: !1,
        writable: !0,
        value: void 0
    };
    n = function(t, e) {
        if (c(t),
        null === e || o(e))
            return t;
        throw new TypeError("Prototype must be null or an object")
    }
    ,
    t.exports = function(t) {
        var e, r;
        return t ? (2 === t.level ? t.set ? (r = t.set,
        e = function(t, e) {
            return r.call(n(t, e), e),
            t
        }
        ) : e = function(t, e) {
            return n(t, e).__proto__ = e,
            t
        }
        : e = function t(e, r) {
            var o;
            return n(e, r),
            (o = l.call(t.nullPolyfill, e)) && delete t.nullPolyfill.__proto__,
            null === r && (r = t.nullPolyfill),
            e.__proto__ = r,
            o && f(t.nullPolyfill, "__proto__", h),
            e
        }
        ,
        Object.defineProperty(e, "level", {
            configurable: !1,
            enumerable: !1,
            writable: !1,
            value: t.level
        })) : null
    }(function() {
        var t, e = Object.create(null), r = {}, desc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__");
        if (desc) {
            try {
                (t = desc.set).call(e, r)
            } catch (t) {}
            if (Object.getPrototypeOf(e) === r)
                return {
                    set: t,
                    level: 2
                }
        }
        return e.__proto__ = r,
        Object.getPrototypeOf(e) === r ? {
            level: 2
        } : ((e = {}).__proto__ = r,
        Object.getPrototypeOf(e) === r && {
            level: 1
        })
    }()),
    r(455)
}
, function(t, e, r) {
    "use strict";
    var n = r(456)
      , o = /^\s*class[\s{/}]/
      , c = Function.prototype.toString;
    t.exports = function(t) {
        return !!n(t) && !o.test(c.call(t))
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(392)
      , o = Array.prototype.forEach
      , c = Object.create
      , l = function(t, e) {
        var r;
        for (r in t)
            e[r] = t[r]
    };
    t.exports = function(t) {
        var e = c(null);
        return o.call(arguments, (function(t) {
            n(t) && l(Object(t), e)
        }
        )),
        e
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = r(463)() ? String.prototype.contains : r(464)
}
, function(t, e, r) {
    "use strict";
    var n = r(470);
    t.exports = function(t) {
        if (!n(t))
            throw new TypeError(t + " is not a symbol");
        return t
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(474);
    t.exports = function(t) {
        if (!n(t))
            throw new TypeError(t + " is not iterable");
        return t
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(393)
      , o = r(403)
      , c = r(480)
      , l = r(481)
      , f = function(t, e) {
        return t.replace("%v", l(e))
    };
    t.exports = function(t, e, r) {
        if (!o(r))
            throw new TypeError(f(e, t));
        if (!n(t)) {
            if ("default"in r)
                return r.default;
            if (r.isOptional)
                return null
        }
        var l = c(r.errorMessage);
        throw n(l) || (l = e),
        new TypeError(f(l, t))
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(388).Buffer
      , o = t.exports;
    for (var c in o.types = {
        0: "reserved",
        1: "connect",
        2: "connack",
        3: "publish",
        4: "puback",
        5: "pubrec",
        6: "pubrel",
        7: "pubcomp",
        8: "subscribe",
        9: "suback",
        10: "unsubscribe",
        11: "unsuback",
        12: "pingreq",
        13: "pingresp",
        14: "disconnect",
        15: "auth"
    },
    o.codes = {},
    o.types) {
        var l = o.types[c];
        o.codes[l] = c
    }
    for (var f in o.CMD_SHIFT = 4,
    o.CMD_MASK = 240,
    o.DUP_MASK = 8,
    o.QOS_MASK = 3,
    o.QOS_SHIFT = 1,
    o.RETAIN_MASK = 1,
    o.LENGTH_MASK = 127,
    o.LENGTH_FIN_MASK = 128,
    o.SESSIONPRESENT_MASK = 1,
    o.SESSIONPRESENT_HEADER = n.from([o.SESSIONPRESENT_MASK]),
    o.CONNACK_HEADER = n.from([o.codes.connack << o.CMD_SHIFT]),
    o.USERNAME_MASK = 128,
    o.PASSWORD_MASK = 64,
    o.WILL_RETAIN_MASK = 32,
    o.WILL_QOS_MASK = 24,
    o.WILL_QOS_SHIFT = 3,
    o.WILL_FLAG_MASK = 4,
    o.CLEAN_SESSION_MASK = 2,
    o.CONNECT_HEADER = n.from([o.codes.connect << o.CMD_SHIFT]),
    o.properties = {
        sessionExpiryInterval: 17,
        willDelayInterval: 24,
        receiveMaximum: 33,
        maximumPacketSize: 39,
        topicAliasMaximum: 34,
        requestResponseInformation: 25,
        requestProblemInformation: 23,
        userProperties: 38,
        authenticationMethod: 21,
        authenticationData: 22,
        payloadFormatIndicator: 1,
        messageExpiryInterval: 2,
        contentType: 3,
        responseTopic: 8,
        correlationData: 9,
        maximumQoS: 36,
        retainAvailable: 37,
        assignedClientIdentifier: 18,
        reasonString: 31,
        wildcardSubscriptionAvailable: 40,
        subscriptionIdentifiersAvailable: 41,
        sharedSubscriptionAvailable: 42,
        serverKeepAlive: 19,
        responseInformation: 26,
        serverReference: 28,
        topicAlias: 35,
        subscriptionIdentifier: 11
    },
    o.propertiesCodes = {},
    o.properties) {
        var h = o.properties[f];
        o.propertiesCodes[h] = f
    }
    function d(t) {
        return [0, 1, 2].map((function(e) {
            return [0, 1].map((function(r) {
                return [0, 1].map((function(c) {
                    var l = n.alloc(1);
                    return l.writeUInt8(o.codes[t] << o.CMD_SHIFT | (r ? o.DUP_MASK : 0) | e << o.QOS_SHIFT | c, 0, !0),
                    l
                }
                ))
            }
            ))
        }
        ))
    }
    o.propertiesTypes = {
        sessionExpiryInterval: "int32",
        willDelayInterval: "int32",
        receiveMaximum: "int16",
        maximumPacketSize: "int32",
        topicAliasMaximum: "int16",
        requestResponseInformation: "byte",
        requestProblemInformation: "byte",
        userProperties: "pair",
        authenticationMethod: "string",
        authenticationData: "binary",
        payloadFormatIndicator: "byte",
        messageExpiryInterval: "int32",
        contentType: "string",
        responseTopic: "string",
        correlationData: "binary",
        maximumQoS: "int8",
        retainAvailable: "byte",
        assignedClientIdentifier: "string",
        reasonString: "string",
        wildcardSubscriptionAvailable: "byte",
        subscriptionIdentifiersAvailable: "byte",
        sharedSubscriptionAvailable: "byte",
        serverKeepAlive: "int16",
        responseInformation: "string",
        serverReference: "string",
        topicAlias: "int16",
        subscriptionIdentifier: "var"
    },
    o.PUBLISH_HEADER = d("publish"),
    o.SUBSCRIBE_HEADER = d("subscribe"),
    o.SUBSCRIBE_OPTIONS_QOS_MASK = 3,
    o.SUBSCRIBE_OPTIONS_NL_MASK = 1,
    o.SUBSCRIBE_OPTIONS_NL_SHIFT = 2,
    o.SUBSCRIBE_OPTIONS_RAP_MASK = 1,
    o.SUBSCRIBE_OPTIONS_RAP_SHIFT = 3,
    o.SUBSCRIBE_OPTIONS_RH_MASK = 3,
    o.SUBSCRIBE_OPTIONS_RH_SHIFT = 4,
    o.SUBSCRIBE_OPTIONS_RH = [0, 16, 32],
    o.SUBSCRIBE_OPTIONS_NL = 4,
    o.SUBSCRIBE_OPTIONS_RAP = 8,
    o.SUBSCRIBE_OPTIONS_QOS = [0, 1, 2],
    o.UNSUBSCRIBE_HEADER = d("unsubscribe"),
    o.ACKS = {
        unsuback: d("unsuback"),
        puback: d("puback"),
        pubcomp: d("pubcomp"),
        pubrel: d("pubrel"),
        pubrec: d("pubrec")
    },
    o.SUBACK_HEADER = n.from([o.codes.suback << o.CMD_SHIFT]),
    o.VERSION3 = n.from([3]),
    o.VERSION4 = n.from([4]),
    o.VERSION5 = n.from([5]),
    o.QOS = [0, 1, 2].map((function(t) {
        return n.from([t])
    }
    )),
    o.EMPTY = {
        pingreq: n.from([o.codes.pingreq << 4, 0]),
        pingresp: n.from([o.codes.pingresp << 4, 0]),
        disconnect: n.from([o.codes.disconnect << 4, 0])
    }
}
, function(t, e, r) {
    (function(n) {
        e.log = function(...t) {
            return "object" == typeof console && console.log && console.log(...t)
        }
        ,
        e.formatArgs = function(e) {
            if (e[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + e[0] + (this.useColors ? "%c " : " ") + "+" + t.exports.humanize(this.diff),
            !this.useColors)
                return;
            const r = "color: " + this.color;
            e.splice(1, 0, r, "color: inherit");
            let n = 0
              , o = 0;
            e[0].replace(/%[a-zA-Z%]/g, t=>{
                "%%" !== t && (n++,
                "%c" === t && (o = n))
            }
            ),
            e.splice(o, 0, r)
        }
        ,
        e.save = function(t) {
            try {
                t ? e.storage.setItem("debug", t) : e.storage.removeItem("debug")
            } catch (t) {}
        }
        ,
        e.load = function() {
            let t;
            try {
                t = e.storage.getItem("debug")
            } catch (t) {}
            !t && void 0 !== n && "env"in n && (t = n.env.DEBUG);
            return t
        }
        ,
        e.useColors = function() {
            if ("undefined" != typeof window && window.process && ("renderer" === window.process.type || window.process.__nwjs))
                return !0;
            if ("undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))
                return !1;
            return "undefined" != typeof document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || "undefined" != typeof window && window.console && (window.console.firebug || window.console.exception && window.console.table) || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)
        }
        ,
        e.storage = function() {
            try {
                return localStorage
            } catch (t) {}
        }(),
        e.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"],
        t.exports = r(505)(e);
        const {formatters: o} = t.exports;
        o.j = function(t) {
            try {
                return JSON.stringify(t)
            } catch (t) {
                return "[UnexpectedJSONParseError]: " + t.message
            }
        }
    }
    ).call(this, r(147))
}
, function(t, e, r) {
    "use strict";
    var n = r(427)
      , o = r(388).Buffer
      , c = o.allocUnsafe(0)
      , l = o.from([0])
      , f = r(508)
      , h = r(395).nextTick
      , d = r(428)("mqtt-packet:writeToStream")
      , y = f.cache
      , _ = f.generateNumber
      , m = f.generateCache
      , v = f.genBufVariableByteInt
      , w = f.generate4ByteBuffer
      , S = P
      , E = !0;
    function k(t, e, r) {
        switch (d("generate called"),
        e.cork && (e.cork(),
        h(x, e)),
        E && (E = !1,
        m()),
        d("generate: packet.cmd: %s", t.cmd),
        t.cmd) {
        case "connect":
            return function(t, e, r) {
                var c = t || {}
                  , l = c.protocolId || "MQTT"
                  , f = c.protocolVersion || 4
                  , h = c.will
                  , d = c.clean
                  , y = c.keepalive || 0
                  , _ = c.clientId || ""
                  , m = c.username
                  , v = c.password
                  , w = c.properties;
                void 0 === d && (d = !0);
                var E = 0;
                if (!l || "string" != typeof l && !o.isBuffer(l))
                    return e.emit("error", new Error("Invalid protocolId")),
                    !1;
                E += l.length + 2;
                if (3 !== f && 4 !== f && 5 !== f)
                    return e.emit("error", new Error("Invalid protocol version")),
                    !1;
                E += 1;
                if ("string" != typeof _ && !o.isBuffer(_) || !_ && 4 !== f || !_ && !d) {
                    if (f < 4)
                        return e.emit("error", new Error("clientId must be supplied before 3.1.1")),
                        !1;
                    if (1 * d == 0)
                        return e.emit("error", new Error("clientId must be given if cleanSession set to 0")),
                        !1
                } else
                    E += _.length + 2;
                if ("number" != typeof y || y < 0 || y > 65535 || y % 1 != 0)
                    return e.emit("error", new Error("Invalid keepalive")),
                    !1;
                E += 2;
                if (E += 1,
                5 === f) {
                    var k = R(e, w);
                    if (!k)
                        return !1;
                    E += k.length
                }
                if (h) {
                    if ("object" != typeof h)
                        return e.emit("error", new Error("Invalid will")),
                        !1;
                    if (!h.topic || "string" != typeof h.topic)
                        return e.emit("error", new Error("Invalid will topic")),
                        !1;
                    if (E += o.byteLength(h.topic) + 2,
                    E += 2,
                    h.payload) {
                        if (!(h.payload.length >= 0))
                            return e.emit("error", new Error("Invalid will payload")),
                            !1;
                        "string" == typeof h.payload ? E += o.byteLength(h.payload) : E += h.payload.length
                    }
                    var x = {};
                    if (5 === f) {
                        if (!(x = R(e, h.properties)))
                            return !1;
                        E += x.length
                    }
                }
                var I = !1;
                if (null != m) {
                    if (!L(m))
                        return e.emit("error", new Error("Invalid username")),
                        !1;
                    I = !0,
                    E += o.byteLength(m) + 2
                }
                if (null != v) {
                    if (!I)
                        return e.emit("error", new Error("Username is required to use password")),
                        !1;
                    if (!L(v))
                        return e.emit("error", new Error("Invalid password")),
                        !1;
                    E += U(v) + 2
                }
                e.write(n.CONNECT_HEADER),
                O(e, E),
                j(e, l),
                e.write(4 === f ? n.VERSION4 : 5 === f ? n.VERSION5 : n.VERSION3);
                var A = 0;
                A |= null != m ? n.USERNAME_MASK : 0,
                A |= null != v ? n.PASSWORD_MASK : 0,
                A |= h && h.retain ? n.WILL_RETAIN_MASK : 0,
                A |= h && h.qos ? h.qos << n.WILL_QOS_SHIFT : 0,
                A |= h ? n.WILL_FLAG_MASK : 0,
                A |= d ? n.CLEAN_SESSION_MASK : 0,
                e.write(o.from([A])),
                S(e, y),
                5 === f && k.write();
                j(e, _),
                h && (5 === f && x.write(),
                C(e, h.topic),
                j(e, h.payload));
                null != m && j(e, m);
                null != v && j(e, v);
                return !0
            }(t, e);
        case "connack":
            return function(t, e, r) {
                var c = r ? r.protocolVersion : 4
                  , f = t || {}
                  , h = 5 === c ? f.reasonCode : f.returnCode
                  , d = f.properties
                  , y = 2;
                if ("number" != typeof h)
                    return e.emit("error", new Error("Invalid return code")),
                    !1;
                var _ = null;
                if (5 === c) {
                    if (!(_ = R(e, d)))
                        return !1;
                    y += _.length
                }
                e.write(n.CONNACK_HEADER),
                O(e, y),
                e.write(f.sessionPresent ? n.SESSIONPRESENT_HEADER : l),
                e.write(o.from([h])),
                null != _ && _.write();
                return !0
            }(t, e, r);
        case "publish":
            return function(t, e, r) {
                d("publish: packet: %o", t);
                var l = r ? r.protocolVersion : 4
                  , f = t || {}
                  , h = f.qos || 0
                  , y = f.retain ? n.RETAIN_MASK : 0
                  , _ = f.topic
                  , m = f.payload || c
                  , v = f.messageId
                  , w = f.properties
                  , E = 0;
                if ("string" == typeof _)
                    E += o.byteLength(_) + 2;
                else {
                    if (!o.isBuffer(_))
                        return e.emit("error", new Error("Invalid topic")),
                        !1;
                    E += _.length + 2
                }
                o.isBuffer(m) ? E += m.length : E += o.byteLength(m);
                if (h && "number" != typeof v)
                    return e.emit("error", new Error("Invalid messageId")),
                    !1;
                h && (E += 2);
                var k = null;
                if (5 === l) {
                    if (!(k = R(e, w)))
                        return !1;
                    E += k.length
                }
                e.write(n.PUBLISH_HEADER[h][f.dup ? 1 : 0][y ? 1 : 0]),
                O(e, E),
                S(e, U(_)),
                e.write(_),
                h > 0 && S(e, v);
                null != k && k.write();
                return d("publish: payload: %o", m),
                e.write(m)
            }(t, e, r);
        case "puback":
        case "pubrec":
        case "pubrel":
        case "pubcomp":
            return function(t, e, r) {
                var c = r ? r.protocolVersion : 4
                  , l = t || {}
                  , f = l.cmd || "puback"
                  , h = l.messageId
                  , d = l.dup && "pubrel" === f ? n.DUP_MASK : 0
                  , y = 0
                  , _ = l.reasonCode
                  , m = l.properties
                  , v = 5 === c ? 3 : 2;
                "pubrel" === f && (y = 1);
                if ("number" != typeof h)
                    return e.emit("error", new Error("Invalid messageId")),
                    !1;
                var w = null;
                if (5 === c && "object" == typeof m) {
                    if (!(w = M(e, m, r, v)))
                        return !1;
                    v += w.length
                }
                e.write(n.ACKS[f][y][d][0]),
                O(e, v),
                S(e, h),
                5 === c && e.write(o.from([_]));
                null !== w && w.write();
                return !0
            }(t, e, r);
        case "subscribe":
            return function(t, e, r) {
                d("subscribe: packet: ");
                var c = r ? r.protocolVersion : 4
                  , l = t || {}
                  , f = l.dup ? n.DUP_MASK : 0
                  , h = l.messageId
                  , y = l.subscriptions
                  , _ = l.properties
                  , m = 0;
                if ("number" != typeof h)
                    return e.emit("error", new Error("Invalid messageId")),
                    !1;
                m += 2;
                var v = null;
                if (5 === c) {
                    if (!(v = R(e, _)))
                        return !1;
                    m += v.length
                }
                if ("object" != typeof y || !y.length)
                    return e.emit("error", new Error("Invalid subscriptions")),
                    !1;
                for (var i = 0; i < y.length; i += 1) {
                    var w = y[i].topic
                      , E = y[i].qos;
                    if ("string" != typeof w)
                        return e.emit("error", new Error("Invalid subscriptions - invalid topic")),
                        !1;
                    if ("number" != typeof E)
                        return e.emit("error", new Error("Invalid subscriptions - invalid qos")),
                        !1;
                    if (5 === c) {
                        if ("boolean" != typeof (y[i].nl || !1))
                            return e.emit("error", new Error("Invalid subscriptions - invalid No Local")),
                            !1;
                        if ("boolean" != typeof (y[i].rap || !1))
                            return e.emit("error", new Error("Invalid subscriptions - invalid Retain as Published")),
                            !1;
                        var k = y[i].rh || 0;
                        if ("number" != typeof k || k > 2)
                            return e.emit("error", new Error("Invalid subscriptions - invalid Retain Handling")),
                            !1
                    }
                    m += o.byteLength(w) + 2 + 1
                }
                d("subscribe: writing to stream: %o", n.SUBSCRIBE_HEADER),
                e.write(n.SUBSCRIBE_HEADER[1][f ? 1 : 0][0]),
                O(e, m),
                S(e, h),
                null !== v && v.write();
                for (var x = !0, I = 0; I < y.length; I++) {
                    var A, sub = y[I], P = sub.topic, T = sub.qos, j = +sub.nl, M = +sub.rap, B = sub.rh;
                    C(e, P),
                    A = n.SUBSCRIBE_OPTIONS_QOS[T],
                    5 === c && (A |= j ? n.SUBSCRIBE_OPTIONS_NL : 0,
                    A |= M ? n.SUBSCRIBE_OPTIONS_RAP : 0,
                    A |= B ? n.SUBSCRIBE_OPTIONS_RH[B] : 0),
                    x = e.write(o.from([A]))
                }
                return x
            }(t, e, r);
        case "suback":
            return function(t, e, r) {
                var c = r ? r.protocolVersion : 4
                  , l = t || {}
                  , f = l.messageId
                  , h = l.granted
                  , d = l.properties
                  , y = 0;
                if ("number" != typeof f)
                    return e.emit("error", new Error("Invalid messageId")),
                    !1;
                y += 2;
                if ("object" != typeof h || !h.length)
                    return e.emit("error", new Error("Invalid qos vector")),
                    !1;
                for (var i = 0; i < h.length; i += 1) {
                    if ("number" != typeof h[i])
                        return e.emit("error", new Error("Invalid qos vector")),
                        !1;
                    y += 1
                }
                var _ = null;
                if (5 === c) {
                    if (!(_ = M(e, d, r, y)))
                        return !1;
                    y += _.length
                }
                e.write(n.SUBACK_HEADER),
                O(e, y),
                S(e, f),
                null !== _ && _.write();
                return e.write(o.from(h))
            }(t, e, r);
        case "unsubscribe":
            return function(t, e, r) {
                var c = r ? r.protocolVersion : 4
                  , l = t || {}
                  , f = l.messageId
                  , h = l.dup ? n.DUP_MASK : 0
                  , d = l.unsubscriptions
                  , y = l.properties
                  , _ = 0;
                if ("number" != typeof f)
                    return e.emit("error", new Error("Invalid messageId")),
                    !1;
                _ += 2;
                if ("object" != typeof d || !d.length)
                    return e.emit("error", new Error("Invalid unsubscriptions")),
                    !1;
                for (var i = 0; i < d.length; i += 1) {
                    if ("string" != typeof d[i])
                        return e.emit("error", new Error("Invalid unsubscriptions")),
                        !1;
                    _ += o.byteLength(d[i]) + 2
                }
                var m = null;
                if (5 === c) {
                    if (!(m = R(e, y)))
                        return !1;
                    _ += m.length
                }
                e.write(n.UNSUBSCRIBE_HEADER[1][h ? 1 : 0][0]),
                O(e, _),
                S(e, f),
                null !== m && m.write();
                for (var v = !0, w = 0; w < d.length; w++)
                    v = C(e, d[w]);
                return v
            }(t, e, r);
        case "unsuback":
            return function(t, e, r) {
                var c = r ? r.protocolVersion : 4
                  , l = t || {}
                  , f = l.messageId
                  , h = l.dup ? n.DUP_MASK : 0
                  , d = l.granted
                  , y = l.properties
                  , _ = l.cmd
                  , m = 2;
                if ("number" != typeof f)
                    return e.emit("error", new Error("Invalid messageId")),
                    !1;
                if (5 === c) {
                    if ("object" != typeof d || !d.length)
                        return e.emit("error", new Error("Invalid qos vector")),
                        !1;
                    for (var i = 0; i < d.length; i += 1) {
                        if ("number" != typeof d[i])
                            return e.emit("error", new Error("Invalid qos vector")),
                            !1;
                        m += 1
                    }
                }
                var v = null;
                if (5 === c) {
                    if (!(v = M(e, y, r, m)))
                        return !1;
                    m += v.length
                }
                e.write(n.ACKS[_][0][h][0]),
                O(e, m),
                S(e, f),
                null !== v && v.write();
                5 === c && e.write(o.from(d));
                return !0
            }(t, e, r);
        case "pingreq":
        case "pingresp":
            return function(t, e, r) {
                return e.write(n.EMPTY[t.cmd])
            }(t, e);
        case "disconnect":
            return function(t, e, r) {
                var c = r ? r.protocolVersion : 4
                  , l = t || {}
                  , f = l.reasonCode
                  , h = l.properties
                  , d = 5 === c ? 1 : 0
                  , y = null;
                if (5 === c) {
                    if (!(y = M(e, h, r, d)))
                        return !1;
                    d += y.length
                }
                e.write(o.from([n.codes.disconnect << 4])),
                O(e, d),
                5 === c && e.write(o.from([f]));
                null !== y && y.write();
                return !0
            }(t, e, r);
        case "auth":
            return function(t, e, r) {
                var c = r ? r.protocolVersion : 4
                  , l = t || {}
                  , f = l.reasonCode
                  , h = l.properties
                  , d = 5 === c ? 1 : 0;
                5 !== c && e.emit("error", new Error("Invalid mqtt version for auth packet"));
                var y = M(e, h, r, d);
                if (!y)
                    return !1;
                d += y.length,
                e.write(o.from([n.codes.auth << 4])),
                O(e, d),
                e.write(o.from([f])),
                null !== y && y.write();
                return !0
            }(t, e, r);
        default:
            return e.emit("error", new Error("Unknown command")),
            !1
        }
    }
    function x(t) {
        t.uncork()
    }
    Object.defineProperty(k, "cacheNumbers", {
        get: function() {
            return S === P
        },
        set: function(t) {
            t ? (y && 0 !== Object.keys(y).length || (E = !0),
            S = P) : (E = !1,
            S = T)
        }
    });
    var I = {};
    function O(t, e) {
        var r = I[e];
        r || (r = v(e).data,
        e < 16384 && (I[e] = r)),
        d("writeVarByteInt: writing to stream: %o", r),
        t.write(r)
    }
    function C(t, e) {
        var r = o.byteLength(e);
        return S(t, r),
        d("writeString: %s", e),
        t.write(e, "utf8")
    }
    function A(t, e, r) {
        C(t, e),
        C(t, r)
    }
    function P(t, e) {
        return d("writeNumberCached: number: %d", e),
        d("writeNumberCached: %o", y[e]),
        t.write(y[e])
    }
    function T(t, e) {
        var r = _(e);
        return d("writeNumberGenerated: %o", r),
        t.write(r)
    }
    function j(t, e) {
        "string" == typeof e ? C(t, e) : e ? (S(t, e.length),
        t.write(e)) : S(t, 0)
    }
    function R(t, e) {
        if ("object" != typeof e || null != e.length)
            return {
                length: 1,
                write: function() {
                    N(t, {}, 0)
                }
            };
        var r = 0;
        function c(e, r) {
            var c = 0;
            switch (n.propertiesTypes[e]) {
            case "byte":
                if ("boolean" != typeof r)
                    return t.emit("error", new Error("Invalid " + e + ": " + r)),
                    !1;
                c += 2;
                break;
            case "int8":
                if ("number" != typeof r || r < 0 || r > 255)
                    return t.emit("error", new Error("Invalid " + e + ": " + r)),
                    !1;
                c += 2;
                break;
            case "binary":
                if (r && null === r)
                    return t.emit("error", new Error("Invalid " + e + ": " + r)),
                    !1;
                c += 1 + o.byteLength(r) + 2;
                break;
            case "int16":
                if ("number" != typeof r || r < 0 || r > 65535)
                    return t.emit("error", new Error("Invalid " + e + ": " + r)),
                    !1;
                c += 3;
                break;
            case "int32":
                if ("number" != typeof r || r < 0 || r > 4294967295)
                    return t.emit("error", new Error("Invalid " + e + ": " + r)),
                    !1;
                c += 5;
                break;
            case "var":
                if ("number" != typeof r || r < 0 || r > 4294967295)
                    return t.emit("error", new Error("Invalid " + e + ": " + r)),
                    !1;
                c += 1 + v(r).length;
                break;
            case "string":
                if ("string" != typeof r)
                    return t.emit("error", new Error("Invalid " + e + ": " + r)),
                    !1;
                c += 3 + o.byteLength(r.toString());
                break;
            case "pair":
                if ("object" != typeof r)
                    return t.emit("error", new Error("Invalid " + e + ": " + r)),
                    !1;
                c += Object.getOwnPropertyNames(r).reduce((function(t, e) {
                    var n = r[e];
                    return Array.isArray(n) ? t += n.reduce((function(t, r) {
                        return t += 3 + o.byteLength(e.toString()) + 2 + o.byteLength(r.toString())
                    }
                    ), 0) : t += 3 + o.byteLength(e.toString()) + 2 + o.byteLength(r[e].toString()),
                    t
                }
                ), 0);
                break;
            default:
                return t.emit("error", new Error("Invalid property " + e + ": " + r)),
                !1
            }
            return c
        }
        if (e)
            for (var l in e) {
                var f = 0
                  , h = 0
                  , d = e[l];
                if (Array.isArray(d))
                    for (var y = 0; y < d.length; y++) {
                        if (!(h = c(l, d[y])))
                            return !1;
                        f += h
                    }
                else {
                    if (!(h = c(l, d)))
                        return !1;
                    f = h
                }
                if (!f)
                    return !1;
                r += f
            }
        return {
            length: v(r).length + r,
            write: function() {
                N(t, e, r)
            }
        }
    }
    function M(t, e, r, n) {
        var o = ["reasonString", "userProperties"]
          , c = r && r.properties && r.properties.maximumPacketSize ? r.properties.maximumPacketSize : 0
          , l = R(t, e);
        if (c)
            for (; n + l.length > c; ) {
                var f = o.shift();
                if (!f || !e[f])
                    return !1;
                delete e[f],
                l = R(t, e)
            }
        return l
    }
    function B(t, e, r) {
        switch (n.propertiesTypes[e]) {
        case "byte":
            t.write(o.from([n.properties[e]])),
            t.write(o.from([+r]));
            break;
        case "int8":
            t.write(o.from([n.properties[e]])),
            t.write(o.from([r]));
            break;
        case "binary":
            t.write(o.from([n.properties[e]])),
            j(t, r);
            break;
        case "int16":
            t.write(o.from([n.properties[e]])),
            S(t, r);
            break;
        case "int32":
            t.write(o.from([n.properties[e]])),
            function(t, e) {
                var r = w(e);
                d("write4ByteNumber: %o", r),
                t.write(r)
            }(t, r);
            break;
        case "var":
            t.write(o.from([n.properties[e]])),
            O(t, r);
            break;
        case "string":
            t.write(o.from([n.properties[e]])),
            C(t, r);
            break;
        case "pair":
            Object.getOwnPropertyNames(r).forEach((function(c) {
                var l = r[c];
                Array.isArray(l) ? l.forEach((function(r) {
                    t.write(o.from([n.properties[e]])),
                    A(t, c.toString(), r.toString())
                }
                )) : (t.write(o.from([n.properties[e]])),
                A(t, c.toString(), l.toString()))
            }
            ));
            break;
        default:
            return t.emit("error", new Error("Invalid property " + e + " value: " + r)),
            !1
        }
    }
    function N(t, e, r) {
        for (var n in O(t, r),
        e)
            if (e.hasOwnProperty(n) && null !== e[n]) {
                var o = e[n];
                if (Array.isArray(o))
                    for (var c = 0; c < o.length; c++)
                        B(t, n, o[c]);
                else
                    B(t, n, o)
            }
    }
    function U(t) {
        return t ? t instanceof o ? t.length : o.byteLength(t) : 0
    }
    function L(t) {
        return "string" == typeof t || t instanceof o
    }
    t.exports = k
}
, function(t, e, r) {
    "use strict";
    var n = r(511)
      , o = r(512);
    function c() {
        this.protocol = null,
        this.slashes = null,
        this.auth = null,
        this.host = null,
        this.port = null,
        this.hostname = null,
        this.hash = null,
        this.search = null,
        this.query = null,
        this.pathname = null,
        this.path = null,
        this.href = null
    }
    e.parse = I,
    e.resolve = function(source, t) {
        return I(source, !1, !0).resolve(t)
    }
    ,
    e.resolveObject = function(source, t) {
        return source ? I(source, !1, !0).resolveObject(t) : t
    }
    ,
    e.format = function(t) {
        o.isString(t) && (t = I(t));
        return t instanceof c ? t.format() : c.prototype.format.call(t)
    }
    ,
    e.Url = c;
    var l = /^([a-z0-9.+-]+:)/i
      , f = /:[0-9]*$/
      , h = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
      , d = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
      , y = ["'"].concat(d)
      , _ = ["%", "/", "?", ";", "#"].concat(y)
      , m = ["/", "?", "#"]
      , v = /^[+a-z0-9A-Z_-]{0,63}$/
      , w = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
      , S = {
        javascript: !0,
        "javascript:": !0
    }
      , E = {
        javascript: !0,
        "javascript:": !0
    }
      , k = {
        http: !0,
        https: !0,
        ftp: !0,
        gopher: !0,
        file: !0,
        "http:": !0,
        "https:": !0,
        "ftp:": !0,
        "gopher:": !0,
        "file:": !0
    }
      , x = r(513);
    function I(t, e, r) {
        if (t && o.isObject(t) && t instanceof c)
            return t;
        var u = new c;
        return u.parse(t, e, r),
        u
    }
    c.prototype.parse = function(t, e, r) {
        if (!o.isString(t))
            throw new TypeError("Parameter 'url' must be a string, not " + typeof t);
        var c = t.indexOf("?")
          , f = -1 !== c && c < t.indexOf("#") ? "?" : "#"
          , d = t.split(f);
        d[0] = d[0].replace(/\\/g, "/");
        var I = t = d.join(f);
        if (I = I.trim(),
        !r && 1 === t.split("#").length) {
            var O = h.exec(I);
            if (O)
                return this.path = I,
                this.href = I,
                this.pathname = O[1],
                O[2] ? (this.search = O[2],
                this.query = e ? x.parse(this.search.substr(1)) : this.search.substr(1)) : e && (this.search = "",
                this.query = {}),
                this
        }
        var C = l.exec(I);
        if (C) {
            var A = (C = C[0]).toLowerCase();
            this.protocol = A,
            I = I.substr(C.length)
        }
        if (r || C || I.match(/^\/\/[^@\/]+@[^@\/]+/)) {
            var P = "//" === I.substr(0, 2);
            !P || C && E[C] || (I = I.substr(2),
            this.slashes = !0)
        }
        if (!E[C] && (P || C && !k[C])) {
            for (var T, j, R = -1, i = 0; i < m.length; i++) {
                -1 !== (M = I.indexOf(m[i])) && (-1 === R || M < R) && (R = M)
            }
            -1 !== (j = -1 === R ? I.lastIndexOf("@") : I.lastIndexOf("@", R)) && (T = I.slice(0, j),
            I = I.slice(j + 1),
            this.auth = decodeURIComponent(T)),
            R = -1;
            for (i = 0; i < _.length; i++) {
                var M;
                -1 !== (M = I.indexOf(_[i])) && (-1 === R || M < R) && (R = M)
            }
            -1 === R && (R = I.length),
            this.host = I.slice(0, R),
            I = I.slice(R),
            this.parseHost(),
            this.hostname = this.hostname || "";
            var B = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
            if (!B)
                for (var N = this.hostname.split(/\./), U = (i = 0,
                N.length); i < U; i++) {
                    var L = N[i];
                    if (L && !L.match(v)) {
                        for (var D = "", F = 0, z = L.length; F < z; F++)
                            L.charCodeAt(F) > 127 ? D += "x" : D += L[F];
                        if (!D.match(v)) {
                            var K = N.slice(0, i)
                              , W = N.slice(i + 1)
                              , H = L.match(w);
                            H && (K.push(H[1]),
                            W.unshift(H[2])),
                            W.length && (I = "/" + W.join(".") + I),
                            this.hostname = K.join(".");
                            break
                        }
                    }
                }
            this.hostname.length > 255 ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
            B || (this.hostname = n.toASCII(this.hostname));
            var p = this.port ? ":" + this.port : ""
              , V = this.hostname || "";
            this.host = V + p,
            this.href += this.host,
            B && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
            "/" !== I[0] && (I = "/" + I))
        }
        if (!S[A])
            for (i = 0,
            U = y.length; i < U; i++) {
                var Y = y[i];
                if (-1 !== I.indexOf(Y)) {
                    var Q = encodeURIComponent(Y);
                    Q === Y && (Q = escape(Y)),
                    I = I.split(Y).join(Q)
                }
            }
        var $ = I.indexOf("#");
        -1 !== $ && (this.hash = I.substr($),
        I = I.slice(0, $));
        var G = I.indexOf("?");
        if (-1 !== G ? (this.search = I.substr(G),
        this.query = I.substr(G + 1),
        e && (this.query = x.parse(this.query)),
        I = I.slice(0, G)) : e && (this.search = "",
        this.query = {}),
        I && (this.pathname = I),
        k[A] && this.hostname && !this.pathname && (this.pathname = "/"),
        this.pathname || this.search) {
            p = this.pathname || "";
            var s = this.search || "";
            this.path = p + s
        }
        return this.href = this.format(),
        this
    }
    ,
    c.prototype.format = function() {
        var t = this.auth || "";
        t && (t = (t = encodeURIComponent(t)).replace(/%3A/i, ":"),
        t += "@");
        var e = this.protocol || ""
          , r = this.pathname || ""
          , n = this.hash || ""
          , c = !1
          , l = "";
        this.host ? c = t + this.host : this.hostname && (c = t + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
        this.port && (c += ":" + this.port)),
        this.query && o.isObject(this.query) && Object.keys(this.query).length && (l = x.stringify(this.query));
        var f = this.search || l && "?" + l || "";
        return e && ":" !== e.substr(-1) && (e += ":"),
        this.slashes || (!e || k[e]) && !1 !== c ? (c = "//" + (c || ""),
        r && "/" !== r.charAt(0) && (r = "/" + r)) : c || (c = ""),
        n && "#" !== n.charAt(0) && (n = "#" + n),
        f && "?" !== f.charAt(0) && (f = "?" + f),
        e + c + (r = r.replace(/[?#]/g, (function(t) {
            return encodeURIComponent(t)
        }
        ))) + (f = f.replace("#", "%23")) + n
    }
    ,
    c.prototype.resolve = function(t) {
        return this.resolveObject(I(t, !1, !0)).format()
    }
    ,
    c.prototype.resolveObject = function(t) {
        if (o.isString(t)) {
            var e = new c;
            e.parse(t, !1, !0),
            t = e
        }
        for (var r = new c, n = Object.keys(this), l = 0; l < n.length; l++) {
            var f = n[l];
            r[f] = this[f]
        }
        if (r.hash = t.hash,
        "" === t.href)
            return r.href = r.format(),
            r;
        if (t.slashes && !t.protocol) {
            for (var h = Object.keys(t), d = 0; d < h.length; d++) {
                var y = h[d];
                "protocol" !== y && (r[y] = t[y])
            }
            return k[r.protocol] && r.hostname && !r.pathname && (r.path = r.pathname = "/"),
            r.href = r.format(),
            r
        }
        if (t.protocol && t.protocol !== r.protocol) {
            if (!k[t.protocol]) {
                for (var _ = Object.keys(t), m = 0; m < _.length; m++) {
                    var v = _[m];
                    r[v] = t[v]
                }
                return r.href = r.format(),
                r
            }
            if (r.protocol = t.protocol,
            t.host || E[t.protocol])
                r.pathname = t.pathname;
            else {
                for (var w = (t.pathname || "").split("/"); w.length && !(t.host = w.shift()); )
                    ;
                t.host || (t.host = ""),
                t.hostname || (t.hostname = ""),
                "" !== w[0] && w.unshift(""),
                w.length < 2 && w.unshift(""),
                r.pathname = w.join("/")
            }
            if (r.search = t.search,
            r.query = t.query,
            r.host = t.host || "",
            r.auth = t.auth,
            r.hostname = t.hostname || t.host,
            r.port = t.port,
            r.pathname || r.search) {
                var p = r.pathname || ""
                  , s = r.search || "";
                r.path = p + s
            }
            return r.slashes = r.slashes || t.slashes,
            r.href = r.format(),
            r
        }
        var S = r.pathname && "/" === r.pathname.charAt(0)
          , x = t.host || t.pathname && "/" === t.pathname.charAt(0)
          , I = x || S || r.host && t.pathname
          , O = I
          , C = r.pathname && r.pathname.split("/") || []
          , A = (w = t.pathname && t.pathname.split("/") || [],
        r.protocol && !k[r.protocol]);
        if (A && (r.hostname = "",
        r.port = null,
        r.host && ("" === C[0] ? C[0] = r.host : C.unshift(r.host)),
        r.host = "",
        t.protocol && (t.hostname = null,
        t.port = null,
        t.host && ("" === w[0] ? w[0] = t.host : w.unshift(t.host)),
        t.host = null),
        I = I && ("" === w[0] || "" === C[0])),
        x)
            r.host = t.host || "" === t.host ? t.host : r.host,
            r.hostname = t.hostname || "" === t.hostname ? t.hostname : r.hostname,
            r.search = t.search,
            r.query = t.query,
            C = w;
        else if (w.length)
            C || (C = []),
            C.pop(),
            C = C.concat(w),
            r.search = t.search,
            r.query = t.query;
        else if (!o.isNullOrUndefined(t.search)) {
            if (A)
                r.hostname = r.host = C.shift(),
                (R = !!(r.host && r.host.indexOf("@") > 0) && r.host.split("@")) && (r.auth = R.shift(),
                r.host = r.hostname = R.shift());
            return r.search = t.search,
            r.query = t.query,
            o.isNull(r.pathname) && o.isNull(r.search) || (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")),
            r.href = r.format(),
            r
        }
        if (!C.length)
            return r.pathname = null,
            r.search ? r.path = "/" + r.search : r.path = null,
            r.href = r.format(),
            r;
        for (var P = C.slice(-1)[0], T = (r.host || t.host || C.length > 1) && ("." === P || ".." === P) || "" === P, j = 0, i = C.length; i >= 0; i--)
            "." === (P = C[i]) ? C.splice(i, 1) : ".." === P ? (C.splice(i, 1),
            j++) : j && (C.splice(i, 1),
            j--);
        if (!I && !O)
            for (; j--; j)
                C.unshift("..");
        !I || "" === C[0] || C[0] && "/" === C[0].charAt(0) || C.unshift(""),
        T && "/" !== C.join("/").substr(-1) && C.push("");
        var R, M = "" === C[0] || C[0] && "/" === C[0].charAt(0);
        A && (r.hostname = r.host = M ? "" : C.length ? C.shift() : "",
        (R = !!(r.host && r.host.indexOf("@") > 0) && r.host.split("@")) && (r.auth = R.shift(),
        r.host = r.hostname = R.shift()));
        return (I = I || r.host && C.length) && !M && C.unshift(""),
        C.length ? r.pathname = C.join("/") : (r.pathname = null,
        r.path = null),
        o.isNull(r.pathname) && o.isNull(r.search) || (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")),
        r.auth = t.auth || r.auth,
        r.slashes = r.slashes || t.slashes,
        r.href = r.format(),
        r
    }
    ,
    c.prototype.parseHost = function() {
        var t = this.host
          , e = f.exec(t);
        e && (":" !== (e = e[0]) && (this.port = e.substr(1)),
        t = t.substr(0, t.length - e.length)),
        t && (this.hostname = t)
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(516);
    t.exports = function(t, e) {
        var r, o;
        return e.port = e.port || 1883,
        e.hostname = e.hostname || e.host || "localhost",
        r = e.port,
        o = e.hostname,
        n.createConnection(r, o)
    }
}
, function(t, e, r) {
    "use strict";
    (function(e, n) {
        var o, c, l, f = r(390).Transform, h = r(407);
        t.exports = function(t, r) {
            if (r.hostname = r.hostname || r.host,
            !r.hostname)
                throw new Error("Could not determine host. Specify host manually.");
            var d = "MQIsdp" === r.protocolId && 3 === r.protocolVersion ? "mqttv3.1" : "mqtt";
            !function(t) {
                t.hostname || (t.hostname = "localhost"),
                t.path || (t.path = "/"),
                t.wsOptions || (t.wsOptions = {})
            }(r);
            var y = function(t, e) {
                var r = "wxs" === t.protocol ? "wss" : "ws"
                  , n = r + "://" + t.hostname + t.path;
                return t.port && 80 !== t.port && 443 !== t.port && (n = r + "://" + t.hostname + ":" + t.port + t.path),
                "function" == typeof t.transformWsUrl && (n = t.transformWsUrl(n, t, e)),
                n
            }(r, t);
            o = wx.connectSocket({
                url: y,
                protocols: d
            }),
            c = function() {
                var t = new f;
                return t._write = function(t, e, r) {
                    o.send({
                        data: t.buffer,
                        success: function() {
                            r()
                        },
                        fail: function(t) {
                            r(new Error(t))
                        }
                    })
                }
                ,
                t._flush = function(t) {
                    o.close({
                        success: function() {
                            t()
                        }
                    })
                }
                ,
                t
            }(),
            (l = h.obj())._destroy = function(t, e) {
                o.close({
                    success: function() {
                        e && e(t)
                    }
                })
            }
            ;
            var _ = l.destroy;
            return l.destroy = function() {
                l.destroy = _;
                var t = this;
                n.nextTick((function() {
                    o.close({
                        fail: function() {
                            t._destroy(new Error)
                        }
                    })
                }
                ))
            }
            .bind(l),
            o.onOpen((function() {
                l.setReadable(c),
                l.setWritable(c),
                l.emit("connect")
            }
            )),
            o.onMessage((function(t) {
                var data = t.data;
                data = data instanceof ArrayBuffer ? e.from(data) : e.from(data, "utf8"),
                c.push(data)
            }
            )),
            o.onClose((function() {
                l.end(),
                l.destroy()
            }
            )),
            o.onError((function(t) {
                l.destroy(new Error(t.errMsg))
            }
            )),
            l
        }
    }
    ).call(this, r(391).Buffer, r(147))
}
, function(t, e, r) {
    "use strict";
    (function(e) {
        var n, o, c, l = r(390).Transform, f = r(407), h = r(412), d = !1;
        t.exports = function(t, r) {
            if (r.hostname = r.hostname || r.host,
            !r.hostname)
                throw new Error("Could not determine host. Specify host manually.");
            var y = "MQIsdp" === r.protocolId && 3 === r.protocolVersion ? "mqttv3.1" : "mqtt";
            !function(t) {
                t.hostname || (t.hostname = "localhost"),
                t.path || (t.path = "/"),
                t.wsOptions || (t.wsOptions = {})
            }(r);
            var _ = function(t, e) {
                var r = "alis" === t.protocol ? "wss" : "ws"
                  , n = r + "://" + t.hostname + t.path;
                return t.port && 80 !== t.port && 443 !== t.port && (n = r + "://" + t.hostname + ":" + t.port + t.path),
                "function" == typeof t.transformWsUrl && (n = t.transformWsUrl(n, t, e)),
                n
            }(r, t);
            return (n = r.my).connectSocket({
                url: _,
                protocols: y
            }),
            o = function() {
                var t = new l;
                return t._write = function(t, e, r) {
                    n.sendSocketMessage({
                        data: t.buffer,
                        success: function() {
                            r()
                        },
                        fail: function() {
                            r(new Error)
                        }
                    })
                }
                ,
                t._flush = function(t) {
                    n.closeSocket({
                        success: function() {
                            t()
                        }
                    })
                }
                ,
                t
            }(),
            c = f.obj(),
            d || (d = !0,
            n.onSocketOpen((function() {
                c.setReadable(o),
                c.setWritable(o),
                c.emit("connect")
            }
            )),
            n.onSocketMessage((function(t) {
                if ("string" == typeof t.data) {
                    var r = h.toByteArray(t.data)
                      , n = e.from(r);
                    o.push(n)
                } else {
                    var c = new FileReader;
                    c.addEventListener("load", (function() {
                        var data = c.result;
                        data = data instanceof ArrayBuffer ? e.from(data) : e.from(data, "utf8"),
                        o.push(data)
                    }
                    )),
                    c.readAsArrayBuffer(t.data)
                }
            }
            )),
            n.onSocketClose((function() {
                c.end(),
                c.destroy()
            }
            )),
            n.onSocketError((function(t) {
                c.destroy(t)
            }
            ))),
            c
        }
    }
    ).call(this, r(391).Buffer)
}
, function(t, e, r) {
    "use strict";
    (function(e) {
        var n = r(522)
          , o = r(430)
          , c = ["rejectUnauthorized", "ca", "cert", "key", "pfx", "passphrase"]
          , l = "browser" === e.title;
        function f(t, e) {
            var r = "MQIsdp" === e.protocolId && 3 === e.protocolVersion ? "mqttv3.1" : "mqtt";
            !function(t) {
                t.hostname || (t.hostname = "localhost"),
                t.port || ("wss" === t.protocol ? t.port = 443 : t.port = 80),
                t.path || (t.path = "/"),
                t.wsOptions || (t.wsOptions = {}),
                l || "wss" !== t.protocol || c.forEach((function(e) {
                    t.hasOwnProperty(e) && !t.wsOptions.hasOwnProperty(e) && (t.wsOptions[e] = t[e])
                }
                ))
            }(e);
            var o = function(t, e) {
                var r = t.protocol + "://" + t.hostname + ":" + t.port + t.path;
                return "function" == typeof t.transformWsUrl && (r = t.transformWsUrl(r, t, e)),
                r
            }(e, t);
            return n(o, [r], e.wsOptions)
        }
        t.exports = l ? function(t, e) {
            if (e.hostname || (e.hostname = e.host),
            !e.hostname) {
                if ("undefined" == typeof document)
                    throw new Error("Could not determine host. Specify host manually.");
                var r = o.parse(document.URL);
                e.hostname = r.hostname,
                e.port || (e.port = r.port)
            }
            return f(t, e)
        }
        : function(t, e) {
            return f(t, e)
        }
    }
    ).call(this, r(147))
}
, function(t, e, r) {
    "use strict";
    (function(e, n) {
        var o = r(394)
          , c = r(408)
          , l = r(497)
          , f = r(390).Writable
          , h = r(384)
          , d = r(509)
          , y = r(510)
          , _ = r(401)
          , m = e.setImmediate || function(t) {
            n.nextTick(t)
        }
          , v = {
            keepalive: 60,
            reschedulePings: !0,
            protocolId: "MQTT",
            protocolVersion: 4,
            reconnectPeriod: 1e3,
            connectTimeout: 3e4,
            clean: !0,
            resubscribe: !0
        }
          , w = {
            0: "",
            1: "Unacceptable protocol version",
            2: "Identifier rejected",
            3: "Server unavailable",
            4: "Bad username or password",
            5: "Not authorized",
            16: "No matching subscribers",
            17: "No subscription existed",
            128: "Unspecified error",
            129: "Malformed Packet",
            130: "Protocol Error",
            131: "Implementation specific error",
            132: "Unsupported Protocol Version",
            133: "Client Identifier not valid",
            134: "Bad User Name or Password",
            135: "Not authorized",
            136: "Server unavailable",
            137: "Server busy",
            138: "Banned",
            139: "Server shutting down",
            140: "Bad authentication method",
            141: "Keep Alive timeout",
            142: "Session taken over",
            143: "Topic Filter invalid",
            144: "Topic Name invalid",
            145: "Packet identifier in use",
            146: "Packet Identifier not found",
            147: "Receive Maximum exceeded",
            148: "Topic Alias invalid",
            149: "Packet too large",
            150: "Message rate too high",
            151: "Quota exceeded",
            152: "Administrative action",
            153: "Payload format invalid",
            154: "Retain not supported",
            155: "QoS not supported",
            156: "Use another server",
            157: "Server moved",
            158: "Shared Subscriptions not supported",
            159: "Connection rate exceeded",
            160: "Maximum connect time",
            161: "Subscription Identifiers not supported",
            162: "Wildcard Subscriptions not supported"
        };
        function S(t, e, r) {
            t.emit("packetsend", e),
            !l.writeToStream(e, t.stream, t.options) && r ? t.stream.once("drain", r) : r && r()
        }
        function E(t) {
            t && Object.keys(t).forEach((function(e) {
                "function" == typeof t[e].cb && (t[e].cb(new Error("Connection closed")),
                delete t[e])
            }
            ))
        }
        function k(t, e, r, n) {
            t.outgoingStore.put(e, (function(o) {
                if (o)
                    return r && r(o);
                n(),
                S(t, e, r)
            }
            ))
        }
        function x() {}
        function I(t, e) {
            var r, n = this;
            if (!(this instanceof I))
                return new I(t,e);
            for (r in this.options = e || {},
            v)
                void 0 === this.options[r] ? this.options[r] = v[r] : this.options[r] = e[r];
            this.options.clientId = "string" == typeof e.clientId ? e.clientId : "mqttjs_" + Math.random().toString(16).substr(2, 8),
            this.options.customHandleAcks = 5 === e.protocolVersion && e.customHandleAcks ? e.customHandleAcks : function() {
                arguments[3](0)
            }
            ,
            this.streamBuilder = t,
            this.outgoingStore = e.outgoingStore || new c,
            this.incomingStore = e.incomingStore || new c,
            this.queueQoSZero = void 0 === e.queueQoSZero || e.queueQoSZero,
            this._resubscribeTopics = {},
            this.messageIdToTopic = {},
            this.pingTimer = null,
            this.connected = !1,
            this.disconnecting = !1,
            this.queue = [],
            this.connackTimer = null,
            this.reconnectTimer = null,
            this._storeProcessing = !1,
            this._packetIdsDuringStoreProcessing = {},
            this.nextId = Math.max(1, Math.floor(65535 * Math.random())),
            this.outgoing = {},
            this._firstConnection = !0,
            this.on("close", (function() {
                this.connected = !1,
                clearTimeout(this.connackTimer)
            }
            )),
            this.on("connect", (function() {
                var t = this.queue;
                !function e() {
                    var r, o = t.shift();
                    o && (r = o.packet,
                    n._sendPacket(r, (function(t) {
                        o.cb && o.cb(t),
                        e()
                    }
                    )))
                }()
            }
            )),
            this.on("close", (function() {
                null !== n.pingTimer && (n.pingTimer.clear(),
                n.pingTimer = null)
            }
            )),
            this.on("close", this._setupReconnect),
            o.EventEmitter.call(this),
            this._setupStream()
        }
        h(I, o.EventEmitter),
        I.prototype._setupStream = function() {
            var t, e = this, r = new f, o = l.parser(this.options), c = null, h = [];
            function d() {
                if (h.length)
                    n.nextTick(y);
                else {
                    var t = c;
                    c = null,
                    t()
                }
            }
            function y() {
                var t = h.shift();
                if (t)
                    e._handlePacket(t, d);
                else {
                    var r = c;
                    c = null,
                    r && r()
                }
            }
            if (this._clearReconnect(),
            this.stream = this.streamBuilder(this),
            o.on("packet", (function(t) {
                h.push(t)
            }
            )),
            r._write = function(t, e, r) {
                c = r,
                o.parse(t),
                y()
            }
            ,
            this.stream.pipe(r),
            this.stream.on("error", x),
            this.stream.on("close", (function() {
                var t;
                (t = e.outgoing) && Object.keys(t).forEach((function(e) {
                    t[e].volatile && "function" == typeof t[e].cb && (t[e].cb(new Error("Connection closed")),
                    delete t[e])
                }
                )),
                e.emit("close")
            }
            )),
            (t = Object.create(this.options)).cmd = "connect",
            S(this, t),
            o.on("error", this.emit.bind(this, "error")),
            this.options.properties) {
                if (!this.options.properties.authenticationMethod && this.options.properties.authenticationData)
                    return this.emit("error", new Error("Packet has no Authentication Method")),
                    this;
                if (this.options.properties.authenticationMethod && this.options.authPacket && "object" == typeof this.options.authPacket)
                    S(this, _({
                        cmd: "auth",
                        reasonCode: 0
                    }, this.options.authPacket))
            }
            this.stream.setMaxListeners(1e3),
            clearTimeout(this.connackTimer),
            this.connackTimer = setTimeout((function() {
                e._cleanUp(!0)
            }
            ), this.options.connectTimeout)
        }
        ,
        I.prototype._handlePacket = function(t, e) {
            var r = this.options;
            if (5 === r.protocolVersion && r.properties && r.properties.maximumPacketSize && r.properties.maximumPacketSize < t.length)
                return this.emit("error", new Error("exceeding packets size " + t.cmd)),
                this.end({
                    reasonCode: 149,
                    properties: {
                        reasonString: "Maximum packet size was exceeded"
                    }
                }),
                this;
            switch (this.emit("packetreceive", t),
            t.cmd) {
            case "publish":
                this._handlePublish(t, e);
                break;
            case "puback":
            case "pubrec":
            case "pubcomp":
            case "suback":
            case "unsuback":
                this._handleAck(t),
                e();
                break;
            case "pubrel":
                this._handlePubrel(t, e);
                break;
            case "connack":
                this._handleConnack(t),
                e();
                break;
            case "pingresp":
                this._handlePingresp(t),
                e();
                break;
            case "disconnect":
                this._handleDisconnect(t),
                e()
            }
        }
        ,
        I.prototype._checkDisconnecting = function(t) {
            return this.disconnecting && (t ? t(new Error("client disconnecting")) : this.emit("error", new Error("client disconnecting"))),
            this.disconnecting
        }
        ,
        I.prototype.publish = function(t, e, r, n) {
            var o, c = this.options;
            "function" == typeof r && (n = r,
            r = null);
            if (r = _({
                qos: 0,
                retain: !1,
                dup: !1
            }, r),
            this._checkDisconnecting(n))
                return this;
            switch (o = {
                cmd: "publish",
                topic: t,
                payload: e,
                qos: r.qos,
                retain: r.retain,
                messageId: this._nextId(),
                dup: r.dup
            },
            5 === c.protocolVersion && (o.properties = r.properties,
            (!c.properties && o.properties && o.properties.topicAlias || r.properties && c.properties && (r.properties.topicAlias && c.properties.topicAliasMaximum && r.properties.topicAlias > c.properties.topicAliasMaximum || !c.properties.topicAliasMaximum && r.properties.topicAlias)) && delete o.properties.topicAlias),
            r.qos) {
            case 1:
            case 2:
                this.outgoing[o.messageId] = {
                    volatile: !1,
                    cb: n || x
                },
                this._storeProcessing ? (this._packetIdsDuringStoreProcessing[o.messageId] = !1,
                this._storePacket(o, void 0, r.cbStorePut)) : this._sendPacket(o, void 0, r.cbStorePut);
                break;
            default:
                this._storeProcessing ? this._storePacket(o, n, r.cbStorePut) : this._sendPacket(o, n, r.cbStorePut)
            }
            return this
        }
        ,
        I.prototype.subscribe = function() {
            for (var t, e = new Array(arguments.length), i = 0; i < arguments.length; i++)
                e[i] = arguments[i];
            var r, n = [], o = e.shift(), c = o.resubscribe, l = e.pop() || x, f = e.pop(), h = this, d = this.options.protocolVersion;
            if (delete o.resubscribe,
            "string" == typeof o && (o = [o]),
            "function" != typeof l && (f = l,
            l = x),
            null !== (r = y.validateTopics(o)))
                return m(l, new Error("Invalid topic " + r)),
                this;
            if (this._checkDisconnecting(l))
                return this;
            var v = {
                qos: 0
            };
            if (5 === d && (v.nl = !1,
            v.rap = !1,
            v.rh = 0),
            f = _(v, f),
            Array.isArray(o) ? o.forEach((function(t) {
                if (!h._resubscribeTopics.hasOwnProperty(t) || h._resubscribeTopics[t].qos < f.qos || c) {
                    var e = {
                        topic: t,
                        qos: f.qos
                    };
                    5 === d && (e.nl = f.nl,
                    e.rap = f.rap,
                    e.rh = f.rh,
                    e.properties = f.properties),
                    n.push(e)
                }
            }
            )) : Object.keys(o).forEach((function(t) {
                if (!h._resubscribeTopics.hasOwnProperty(t) || h._resubscribeTopics[t].qos < o[t].qos || c) {
                    var e = {
                        topic: t,
                        qos: o[t].qos
                    };
                    5 === d && (e.nl = o[t].nl,
                    e.rap = o[t].rap,
                    e.rh = o[t].rh,
                    e.properties = f.properties),
                    n.push(e)
                }
            }
            )),
            t = {
                cmd: "subscribe",
                subscriptions: n,
                qos: 1,
                retain: !1,
                dup: !1,
                messageId: this._nextId()
            },
            f.properties && (t.properties = f.properties),
            n.length) {
                if (this.options.resubscribe) {
                    var w = [];
                    n.forEach((function(sub) {
                        if (h.options.reconnectPeriod > 0) {
                            var t = {
                                qos: sub.qos
                            };
                            5 === d && (t.nl = sub.nl || !1,
                            t.rap = sub.rap || !1,
                            t.rh = sub.rh || 0,
                            t.properties = sub.properties),
                            h._resubscribeTopics[sub.topic] = t,
                            w.push(sub.topic)
                        }
                    }
                    )),
                    h.messageIdToTopic[t.messageId] = w
                }
                return this.outgoing[t.messageId] = {
                    volatile: !0,
                    cb: function(t, e) {
                        if (!t)
                            for (var r = e.granted, i = 0; i < r.length; i += 1)
                                n[i].qos = r[i];
                        l(t, n)
                    }
                },
                this._sendPacket(t),
                this
            }
            l(null, [])
        }
        ,
        I.prototype.unsubscribe = function() {
            for (var t = {
                cmd: "unsubscribe",
                qos: 1,
                messageId: this._nextId()
            }, e = this, r = new Array(arguments.length), i = 0; i < arguments.length; i++)
                r[i] = arguments[i];
            var n = r.shift()
              , o = r.pop() || x
              , c = r.pop();
            return "string" == typeof n && (n = [n]),
            "function" != typeof o && (c = o,
            o = x),
            this._checkDisconnecting(o) || ("string" == typeof n ? t.unsubscriptions = [n] : "object" == typeof n && n.length && (t.unsubscriptions = n),
            this.options.resubscribe && t.unsubscriptions.forEach((function(t) {
                delete e._resubscribeTopics[t]
            }
            )),
            "object" == typeof c && c.properties && (t.properties = c.properties),
            this.outgoing[t.messageId] = {
                volatile: !0,
                cb: o
            },
            this._sendPacket(t)),
            this
        }
        ,
        I.prototype.end = function() {
            var t = this
              , e = arguments[0]
              , r = arguments[1]
              , n = arguments[2];
            function o() {
                t.disconnected = !0,
                t.incomingStore.close((function() {
                    t.outgoingStore.close((function() {
                        n && n.apply(null, arguments),
                        t.emit("end")
                    }
                    ))
                }
                )),
                t._deferredReconnect && t._deferredReconnect()
            }
            function c() {
                t._cleanUp(e, m.bind(null, o), r)
            }
            return null != e && "boolean" == typeof e || (n = r || x,
            r = e,
            e = !1,
            "object" != typeof r && (n = r,
            r = null,
            "function" != typeof n && (n = x))),
            "object" != typeof r && (n = r,
            r = null),
            n = n || x,
            this.disconnecting || (this._clearReconnect(),
            this.disconnecting = !0,
            !e && Object.keys(this.outgoing).length > 0 ? this.once("outgoingEmpty", setTimeout.bind(null, c, 10)) : c()),
            this
        }
        ,
        I.prototype.removeOutgoingMessage = function(t) {
            var e = this.outgoing[t] ? this.outgoing[t].cb : null;
            return delete this.outgoing[t],
            this.outgoingStore.del({
                messageId: t
            }, (function() {
                e(new Error("Message removed"))
            }
            )),
            this
        }
        ,
        I.prototype.reconnect = function(t) {
            var e = this
              , r = function() {
                t ? (e.options.incomingStore = t.incomingStore,
                e.options.outgoingStore = t.outgoingStore) : (e.options.incomingStore = null,
                e.options.outgoingStore = null),
                e.incomingStore = e.options.incomingStore || new c,
                e.outgoingStore = e.options.outgoingStore || new c,
                e.disconnecting = !1,
                e.disconnected = !1,
                e._deferredReconnect = null,
                e._reconnect()
            };
            return this.disconnecting && !this.disconnected ? this._deferredReconnect = r : r(),
            this
        }
        ,
        I.prototype._reconnect = function() {
            this.emit("reconnect"),
            this._setupStream()
        }
        ,
        I.prototype._setupReconnect = function() {
            var t = this;
            !t.disconnecting && !t.reconnectTimer && t.options.reconnectPeriod > 0 && (this.reconnecting || (this.emit("offline"),
            this.reconnecting = !0),
            t.reconnectTimer = setInterval((function() {
                t._reconnect()
            }
            ), t.options.reconnectPeriod))
        }
        ,
        I.prototype._clearReconnect = function() {
            this.reconnectTimer && (clearInterval(this.reconnectTimer),
            this.reconnectTimer = null)
        }
        ,
        I.prototype._cleanUp = function(t, e) {
            var r = arguments[2];
            if (e && this.stream.on("close", e),
            t)
                0 === this.options.reconnectPeriod && this.options.clean && E(this.outgoing),
                this.stream.destroy();
            else {
                var n = _({
                    cmd: "disconnect"
                }, r);
                this._sendPacket(n, m.bind(null, this.stream.end.bind(this.stream)))
            }
            this.disconnecting || (this._clearReconnect(),
            this._setupReconnect()),
            null !== this.pingTimer && (this.pingTimer.clear(),
            this.pingTimer = null),
            e && !this.connected && (this.stream.removeListener("close", e),
            e())
        }
        ,
        I.prototype._sendPacket = function(t, e, r) {
            if (r = r || x,
            this.connected) {
                switch (this._shiftPingInterval(),
                t.cmd) {
                case "publish":
                    break;
                case "pubrel":
                    return void k(this, t, e, r);
                default:
                    return void S(this, t, e)
                }
                switch (t.qos) {
                case 2:
                case 1:
                    k(this, t, e, r);
                    break;
                case 0:
                default:
                    S(this, t, e)
                }
            } else
                this._storePacket(t, e, r)
        }
        ,
        I.prototype._storePacket = function(t, e, r) {
            r = r || x,
            0 === (t.qos || 0) && this.queueQoSZero || "publish" !== t.cmd ? this.queue.push({
                packet: t,
                cb: e
            }) : t.qos > 0 ? (e = this.outgoing[t.messageId] ? this.outgoing[t.messageId].cb : null,
            this.outgoingStore.put(t, (function(t) {
                if (t)
                    return e && e(t);
                r()
            }
            ))) : e && e(new Error("No connection to broker"))
        }
        ,
        I.prototype._setupPingTimer = function() {
            var t = this;
            !this.pingTimer && this.options.keepalive && (this.pingResp = !0,
            this.pingTimer = d((function() {
                t._checkPing()
            }
            ), 1e3 * this.options.keepalive))
        }
        ,
        I.prototype._shiftPingInterval = function() {
            this.pingTimer && this.options.keepalive && this.options.reschedulePings && this.pingTimer.reschedule(1e3 * this.options.keepalive)
        }
        ,
        I.prototype._checkPing = function() {
            this.pingResp ? (this.pingResp = !1,
            this._sendPacket({
                cmd: "pingreq"
            })) : this._cleanUp(!0)
        }
        ,
        I.prototype._handlePingresp = function() {
            this.pingResp = !0
        }
        ,
        I.prototype._handleConnack = function(t) {
            var e = this.options
              , r = 5 === e.protocolVersion ? t.reasonCode : t.returnCode;
            if (clearTimeout(this.connackTimer),
            t.properties && (t.properties.topicAliasMaximum && (e.properties || (e.properties = {}),
            e.properties.topicAliasMaximum = t.properties.topicAliasMaximum),
            t.properties.serverKeepAlive && e.keepalive && (e.keepalive = t.properties.serverKeepAlive,
            this._shiftPingInterval()),
            t.properties.maximumPacketSize && (e.properties || (e.properties = {}),
            e.properties.maximumPacketSize = t.properties.maximumPacketSize)),
            0 === r)
                this.reconnecting = !1,
                this._onConnect(t);
            else if (r > 0) {
                var n = new Error("Connection refused: " + w[r]);
                n.code = r,
                this.emit("error", n)
            }
        }
        ,
        I.prototype._handlePublish = function(t, e) {
            e = void 0 !== e ? e : x;
            var r = t.topic.toString()
              , n = t.payload
              , o = t.qos
              , c = t.messageId
              , l = this
              , f = this.options
              , h = [0, 16, 128, 131, 135, 144, 145, 151, 153];
            switch (o) {
            case 2:
                f.customHandleAcks(r, n, t, (function(r, code) {
                    return r instanceof Error || (code = r,
                    r = null),
                    r ? l.emit("error", r) : -1 === h.indexOf(code) ? l.emit("error", new Error("Wrong reason code for pubrec")) : void (code ? l._sendPacket({
                        cmd: "pubrec",
                        messageId: c,
                        reasonCode: code
                    }, e) : l.incomingStore.put(t, (function() {
                        l._sendPacket({
                            cmd: "pubrec",
                            messageId: c
                        }, e)
                    }
                    )))
                }
                ));
                break;
            case 1:
                f.customHandleAcks(r, n, t, (function(o, code) {
                    return o instanceof Error || (code = o,
                    o = null),
                    o ? l.emit("error", o) : -1 === h.indexOf(code) ? l.emit("error", new Error("Wrong reason code for puback")) : (code || l.emit("message", r, n, t),
                    void l.handleMessage(t, (function(t) {
                        if (t)
                            return e && e(t);
                        l._sendPacket({
                            cmd: "puback",
                            messageId: c,
                            reasonCode: code
                        }, e)
                    }
                    )))
                }
                ));
                break;
            case 0:
                this.emit("message", r, n, t),
                this.handleMessage(t, e)
            }
        }
        ,
        I.prototype.handleMessage = function(t, e) {
            e()
        }
        ,
        I.prototype._handleAck = function(t) {
            var e, r = t.messageId, n = t.cmd, o = null, c = this.outgoing[r] ? this.outgoing[r].cb : null, l = this;
            if (c) {
                switch (n) {
                case "pubcomp":
                case "puback":
                    var f = t.reasonCode;
                    f && f > 0 && 16 !== f && ((e = new Error("Publish error: " + w[f])).code = f,
                    c(e, t)),
                    delete this.outgoing[r],
                    this.outgoingStore.del(t, c);
                    break;
                case "pubrec":
                    o = {
                        cmd: "pubrel",
                        qos: 2,
                        messageId: r
                    };
                    var h = t.reasonCode;
                    h && h > 0 && 16 !== h ? ((e = new Error("Publish error: " + w[h])).code = h,
                    c(e, t)) : this._sendPacket(o);
                    break;
                case "suback":
                    delete this.outgoing[r];
                    for (var d = 0; d < t.granted.length; d++)
                        if (0 != (128 & t.granted[d])) {
                            var y = this.messageIdToTopic[r];
                            y && y.forEach((function(t) {
                                delete l._resubscribeTopics[t]
                            }
                            ))
                        }
                    c(null, t);
                    break;
                case "unsuback":
                    delete this.outgoing[r],
                    c(null);
                    break;
                default:
                    l.emit("error", new Error("unrecognized packet type"))
                }
                this.disconnecting && 0 === Object.keys(this.outgoing).length && this.emit("outgoingEmpty")
            }
        }
        ,
        I.prototype._handlePubrel = function(t, e) {
            e = void 0 !== e ? e : x;
            var r = t.messageId
              , n = this
              , o = {
                cmd: "pubcomp",
                messageId: r
            };
            n.incomingStore.get(t, (function(t, r) {
                t ? n._sendPacket(o, e) : (n.emit("message", r.topic, r.payload, r),
                n.handleMessage(r, (function(t) {
                    if (t)
                        return e(t);
                    n.incomingStore.del(r, x),
                    n._sendPacket(o, e)
                }
                )))
            }
            ))
        }
        ,
        I.prototype._handleDisconnect = function(t) {
            this.emit("disconnect", t)
        }
        ,
        I.prototype._nextId = function() {
            var t = this.nextId++;
            return 65536 === this.nextId && (this.nextId = 1),
            t
        }
        ,
        I.prototype.getLastMessageId = function() {
            return 1 === this.nextId ? 65535 : this.nextId - 1
        }
        ,
        I.prototype._resubscribe = function(t) {
            var e = Object.keys(this._resubscribeTopics);
            if (!this._firstConnection && (this.options.clean || 5 === this.options.protocolVersion && !t.sessionPresent) && e.length > 0)
                if (this.options.resubscribe)
                    if (5 === this.options.protocolVersion)
                        for (var r = 0; r < e.length; r++) {
                            var n = {};
                            n[e[r]] = this._resubscribeTopics[e[r]],
                            n.resubscribe = !0,
                            this.subscribe(n, {
                                properties: n[e[r]].properties
                            })
                        }
                    else
                        this._resubscribeTopics.resubscribe = !0,
                        this.subscribe(this._resubscribeTopics);
                else
                    this._resubscribeTopics = {};
            this._firstConnection = !1
        }
        ,
        I.prototype._onConnect = function(t) {
            if (this.disconnected)
                this.emit("connect", t);
            else {
                var e = this;
                this._setupPingTimer(),
                this._resubscribe(t),
                this.connected = !0,
                function r() {
                    var n = e.outgoingStore.createStream();
                    function o() {
                        e._storeProcessing = !1,
                        e._packetIdsDuringStoreProcessing = {}
                    }
                    function c() {
                        n.destroy(),
                        n = null,
                        o()
                    }
                    e.once("close", c),
                    n.on("error", (function(t) {
                        o(),
                        e.removeListener("close", c),
                        e.emit("error", t)
                    }
                    )),
                    n.on("end", (function() {
                        var n = !0;
                        for (var l in e._packetIdsDuringStoreProcessing)
                            if (!e._packetIdsDuringStoreProcessing[l]) {
                                n = !1;
                                break
                            }
                        n ? (o(),
                        e.removeListener("close", c),
                        e.emit("connect", t)) : r()
                    }
                    )),
                    function t() {
                        if (n) {
                            e._storeProcessing = !0;
                            var r, o = n.read(1);
                            o ? e._packetIdsDuringStoreProcessing[o.messageId] ? t() : e.disconnecting || e.reconnectTimer ? n.destroy && n.destroy() : (r = e.outgoing[o.messageId] ? e.outgoing[o.messageId].cb : null,
                            e.outgoing[o.messageId] = {
                                volatile: !1,
                                cb: function(e, n) {
                                    r && r(e, n),
                                    t()
                                }
                            },
                            e._packetIdsDuringStoreProcessing[o.messageId] = !0,
                            e._sendPacket(o)) : n.once("readable", t)
                        }
                    }()
                }()
            }
        }
        ,
        t.exports = I
    }
    ).call(this, r(29), r(147))
}
, function(t, e) {
    e.read = function(t, e, r, n, o) {
        var c, l, f = 8 * o - n - 1, h = (1 << f) - 1, d = h >> 1, y = -7, i = r ? o - 1 : 0, _ = r ? -1 : 1, s = t[e + i];
        for (i += _,
        c = s & (1 << -y) - 1,
        s >>= -y,
        y += f; y > 0; c = 256 * c + t[e + i],
        i += _,
        y -= 8)
            ;
        for (l = c & (1 << -y) - 1,
        c >>= -y,
        y += n; y > 0; l = 256 * l + t[e + i],
        i += _,
        y -= 8)
            ;
        if (0 === c)
            c = 1 - d;
        else {
            if (c === h)
                return l ? NaN : 1 / 0 * (s ? -1 : 1);
            l += Math.pow(2, n),
            c -= d
        }
        return (s ? -1 : 1) * l * Math.pow(2, c - n)
    }
    ,
    e.write = function(t, e, r, n, o, c) {
        var l, f, h, d = 8 * c - o - 1, y = (1 << d) - 1, _ = y >> 1, rt = 23 === o ? Math.pow(2, -24) - Math.pow(2, -77) : 0, i = n ? 0 : c - 1, m = n ? 1 : -1, s = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
        for (e = Math.abs(e),
        isNaN(e) || e === 1 / 0 ? (f = isNaN(e) ? 1 : 0,
        l = y) : (l = Math.floor(Math.log(e) / Math.LN2),
        e * (h = Math.pow(2, -l)) < 1 && (l--,
        h *= 2),
        (e += l + _ >= 1 ? rt / h : rt * Math.pow(2, 1 - _)) * h >= 2 && (l++,
        h /= 2),
        l + _ >= y ? (f = 0,
        l = y) : l + _ >= 1 ? (f = (e * h - 1) * Math.pow(2, o),
        l += _) : (f = e * Math.pow(2, _ - 1) * Math.pow(2, o),
        l = 0)); o >= 8; t[r + i] = 255 & f,
        i += m,
        f /= 256,
        o -= 8)
            ;
        for (l = l << o | f,
        d += o; d > 0; t[r + i] = 255 & l,
        i += m,
        l /= 256,
        d -= 8)
            ;
        t[r + i - m] |= 128 * s
    }
}
, , function(t, e, r) {
    "use strict";
    var n = r(402).Buffer
      , o = r(439);
    t.exports = function() {
        function t() {
            !function(t, e) {
                if (!(t instanceof e))
                    throw new TypeError("Cannot call a class as a function")
            }(this, t),
            this.head = null,
            this.tail = null,
            this.length = 0
        }
        return t.prototype.push = function(t) {
            var e = {
                data: t,
                next: null
            };
            this.length > 0 ? this.tail.next = e : this.head = e,
            this.tail = e,
            ++this.length
        }
        ,
        t.prototype.unshift = function(t) {
            var e = {
                data: t,
                next: this.head
            };
            0 === this.length && (this.tail = e),
            this.head = e,
            ++this.length
        }
        ,
        t.prototype.shift = function() {
            if (0 !== this.length) {
                var t = this.head.data;
                return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next,
                --this.length,
                t
            }
        }
        ,
        t.prototype.clear = function() {
            this.head = this.tail = null,
            this.length = 0
        }
        ,
        t.prototype.join = function(s) {
            if (0 === this.length)
                return "";
            for (var p = this.head, t = "" + p.data; p = p.next; )
                t += s + p.data;
            return t
        }
        ,
        t.prototype.concat = function(t) {
            if (0 === this.length)
                return n.alloc(0);
            if (1 === this.length)
                return this.head.data;
            for (var e, r, o, c = n.allocUnsafe(t >>> 0), p = this.head, i = 0; p; )
                e = p.data,
                r = c,
                o = i,
                e.copy(r, o),
                i += p.data.length,
                p = p.next;
            return c
        }
        ,
        t
    }(),
    o && o.inspect && o.inspect.custom && (t.exports.prototype[o.inspect.custom] = function() {
        var t = o.inspect({
            length: this.length
        });
        return this.constructor.name + " " + t
    }
    )
}
, , function(t, e, r) {
    (function(e) {
        function r(t) {
            try {
                if (!e.localStorage)
                    return !1
            } catch (t) {
                return !1
            }
            var r = e.localStorage[t];
            return null != r && "true" === String(r).toLowerCase()
        }
        t.exports = function(t, e) {
            if (r("noDeprecation"))
                return t;
            var n = !1;
            return function() {
                if (!n) {
                    if (r("throwDeprecation"))
                        throw new Error(e);
                    r("traceDeprecation") ? console.trace(e) : console.warn(e),
                    n = !0
                }
                return t.apply(this, arguments)
            }
        }
    }
    ).call(this, r(29))
}
, function(t, e, r) {
    "use strict";
    t.exports = c;
    var n = r(416)
      , o = Object.create(r(396));
    function c(t) {
        if (!(this instanceof c))
            return new c(t);
        n.call(this, t)
    }
    o.inherits = r(384),
    o.inherits(c, n),
    c.prototype._transform = function(t, e, r) {
        r(null, t)
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = r(443)() ? Map : r(444)
}
, function(t, e, r) {
    "use strict";
    t.exports = function() {
        var map, t;
        if ("function" != typeof Map)
            return !1;
        try {
            map = new Map([["raz", "one"], ["dwa", "two"], ["trzy", "three"]])
        } catch (t) {
            return !1
        }
        return "[object Map]" === String(map) && (3 === map.size && ("function" == typeof map.clear && ("function" == typeof map.delete && ("function" == typeof map.entries && ("function" == typeof map.forEach && ("function" == typeof map.get && ("function" == typeof map.has && ("function" == typeof map.keys && ("function" == typeof map.set && ("function" == typeof map.values && (!1 === (t = map.entries().next()).done && (!!t.value && ("raz" === t.value[0] && "one" === t.value[1])))))))))))))
    }
}
, function(t, e, r) {
    "use strict";
    var n, o = r(417), c = r(446), l = r(397), f = r(389), h = r(385), d = r(383), y = r(465), _ = r(386), m = r(425), v = r(475), w = r(493), S = r(496), E = Function.prototype.call, k = Object.defineProperties, x = Object.getPrototypeOf;
    t.exports = n = function() {
        var t, e, r, o = arguments[0];
        if (!(this instanceof n))
            throw new TypeError("Constructor requires 'new'");
        return r = S && l && Map !== n ? l(new Map, x(this)) : this,
        null != o && m(o),
        k(r, {
            __mapKeysData__: d("c", t = []),
            __mapValuesData__: d("c", e = [])
        }),
        o ? (v(o, (function(r) {
            var n = h(r)[0];
            r = r[1],
            -1 === c.call(t, n) && (t.push(n),
            e.push(r))
        }
        ), r),
        r) : r
    }
    ,
    S && (l && l(n, Map),
    n.prototype = Object.create(Map.prototype, {
        constructor: d(n)
    })),
    y(k(n.prototype, {
        clear: d((function() {
            this.__mapKeysData__.length && (o.call(this.__mapKeysData__),
            o.call(this.__mapValuesData__),
            this.emit("_clear"))
        }
        )),
        delete: d((function(t) {
            var e = c.call(this.__mapKeysData__, t);
            return -1 !== e && (this.__mapKeysData__.splice(e, 1),
            this.__mapValuesData__.splice(e, 1),
            this.emit("_delete", e, t),
            !0)
        }
        )),
        entries: d((function() {
            return new w(this,"key+value")
        }
        )),
        forEach: d((function(t) {
            var e, r, n = arguments[1];
            for (f(t),
            r = (e = this.entries())._next(); void 0 !== r; )
                E.call(t, n, this.__mapValuesData__[r], this.__mapKeysData__[r], this),
                r = e._next()
        }
        )),
        get: d((function(t) {
            var e = c.call(this.__mapKeysData__, t);
            if (-1 !== e)
                return this.__mapValuesData__[e]
        }
        )),
        has: d((function(t) {
            return -1 !== c.call(this.__mapKeysData__, t)
        }
        )),
        keys: d((function() {
            return new w(this,"key")
        }
        )),
        set: d((function(t, e) {
            var r, n = c.call(this.__mapKeysData__, t);
            return -1 === n && (n = this.__mapKeysData__.push(t) - 1,
            r = !0),
            this.__mapValuesData__[n] = e,
            r && this.emit("_add", n, t),
            this
        }
        )),
        size: d.gs((function() {
            return this.__mapKeysData__.length
        }
        )),
        values: d((function() {
            return new w(this,"value")
        }
        )),
        toString: d((function() {
            return "[object Map]"
        }
        ))
    })),
    Object.defineProperty(n.prototype, _.iterator, d((function() {
        return this.entries()
    }
    ))),
    Object.defineProperty(n.prototype, _.toStringTag, d("c", "Map"))
}
, function(t, e, r) {
    "use strict";
    t.exports = function() {}
}
, function(t, e, r) {
    "use strict";
    var n = r(447)
      , o = r(418)
      , c = r(385)
      , l = Array.prototype.indexOf
      , f = Object.prototype.hasOwnProperty
      , h = Math.abs
      , d = Math.floor;
    t.exports = function(t) {
        var i, e, r, y;
        if (!n(t))
            return l.apply(this, arguments);
        for (e = o(c(this).length),
        r = arguments[1],
        i = r = isNaN(r) ? 0 : r >= 0 ? d(r) : o(this.length) - d(h(r)); i < e; ++i)
            if (f.call(this, i) && (y = this[i],
            n(y)))
                return i;
        return -1
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = r(448)() ? Number.isNaN : r(449)
}
, function(t, e, r) {
    "use strict";
    t.exports = function() {
        var t = Number.isNaN;
        return "function" == typeof t && (!t({}) && t(NaN) && !t(34))
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = function(t) {
        return t != t
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(451)
      , o = Math.abs
      , c = Math.floor;
    t.exports = function(t) {
        return isNaN(t) ? 0 : 0 !== (t = Number(t)) && isFinite(t) ? n(t) * c(o(t)) : t
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = r(452)() ? Math.sign : r(453)
}
, function(t, e, r) {
    "use strict";
    t.exports = function() {
        var t = Math.sign;
        return "function" == typeof t && (1 === t(10) && -1 === t(-20))
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = function(t) {
        return t = Number(t),
        isNaN(t) || 0 === t ? t : t > 0 ? 1 : -1
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(392)
      , map = {
        function: !0,
        object: !0
    };
    t.exports = function(t) {
        return n(t) && map[typeof t] || !1
    }
}
, function(t, e, r) {
    "use strict";
    var n, o, c, desc, l = Object.create;
    r(419)() || (n = r(420)),
    t.exports = n ? 1 !== n.level ? l : (o = {},
    c = {},
    desc = {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: void 0
    },
    Object.getOwnPropertyNames(Object.prototype).forEach((function(t) {
        c[t] = "__proto__" !== t ? desc : {
            configurable: !0,
            enumerable: !1,
            writable: !0,
            value: void 0
        }
    }
    )),
    Object.defineProperties(o, c),
    Object.defineProperty(n, "nullPolyfill", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: o
    }),
    function(t, e) {
        return l(null === t ? o : t, e)
    }
    ) : l
}
, function(t, e, r) {
    "use strict";
    var n = r(457);
    t.exports = function(t) {
        if ("function" != typeof t)
            return !1;
        if (!hasOwnProperty.call(t, "length"))
            return !1;
        try {
            if ("number" != typeof t.length)
                return !1;
            if ("function" != typeof t.call)
                return !1;
            if ("function" != typeof t.apply)
                return !1
        } catch (t) {
            return !1
        }
        return !n(t)
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(403);
    t.exports = function(t) {
        if (!n(t))
            return !1;
        try {
            return !!t.constructor && t.constructor.prototype === t
        } catch (t) {
            return !1
        }
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = function() {
        var t, e = Object.assign;
        return "function" == typeof e && (e(t = {
            foo: "raz"
        }, {
            bar: "dwa"
        }, {
            trzy: "trzy"
        }),
        t.foo + t.bar + t.trzy === "razdwatrzy")
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(460)
      , o = r(385)
      , c = Math.max;
    t.exports = function(t, e) {
        var r, i, l, f = c(arguments.length, 2);
        for (t = Object(o(t)),
        l = function(n) {
            try {
                t[n] = e[n]
            } catch (t) {
                r || (r = t)
            }
        }
        ,
        i = 1; i < f; ++i)
            e = arguments[i],
            n(e).forEach(l);
        if (void 0 !== r)
            throw r;
        return t
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = r(461)() ? Object.keys : r(462)
}
, function(t, e, r) {
    "use strict";
    t.exports = function() {
        try {
            return Object.keys("primitive"),
            !0
        } catch (t) {
            return !1
        }
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(392)
      , o = Object.keys;
    t.exports = function(object) {
        return o(n(object) ? Object(object) : object)
    }
}
, function(t, e, r) {
    "use strict";
    var n = "razdwatrzy";
    t.exports = function() {
        return "function" == typeof n.contains && (!0 === n.contains("dwa") && !1 === n.contains("foo"))
    }
}
, function(t, e, r) {
    "use strict";
    var n = String.prototype.indexOf;
    t.exports = function(t) {
        return n.call(this, t, arguments[1]) > -1
    }
}
, function(t, e, r) {
    "use strict";
    var n, o, c, l, f, h, base, d = r(383), y = r(389), _ = Function.prototype.apply, m = Function.prototype.call, v = Object.create, w = Object.defineProperty, S = Object.defineProperties, E = Object.prototype.hasOwnProperty, k = {
        configurable: !0,
        enumerable: !1,
        writable: !0
    };
    o = function(t, e) {
        var r, o;
        return y(e),
        o = this,
        n.call(this, t, r = function() {
            c.call(o, t, r),
            _.call(e, this, arguments)
        }
        ),
        r.__eeOnceListener__ = e,
        this
    }
    ,
    f = {
        on: n = function(t, e) {
            var data;
            return y(e),
            E.call(this, "__ee__") ? data = this.__ee__ : (data = k.value = v(null),
            w(this, "__ee__", k),
            k.value = null),
            data[t] ? "object" == typeof data[t] ? data[t].push(e) : data[t] = [data[t], e] : data[t] = e,
            this
        }
        ,
        once: o,
        off: c = function(t, e) {
            var data, r, n, i;
            if (y(e),
            !E.call(this, "__ee__"))
                return this;
            if (!(data = this.__ee__)[t])
                return this;
            if ("object" == typeof (r = data[t]))
                for (i = 0; n = r[i]; ++i)
                    n !== e && n.__eeOnceListener__ !== e || (2 === r.length ? data[t] = r[i ? 0 : 1] : r.splice(i, 1));
            else
                r !== e && r.__eeOnceListener__ !== e || delete data[t];
            return this
        }
        ,
        emit: l = function(t) {
            var i, e, r, n, o;
            if (E.call(this, "__ee__") && (n = this.__ee__[t]))
                if ("object" == typeof n) {
                    for (e = arguments.length,
                    o = new Array(e - 1),
                    i = 1; i < e; ++i)
                        o[i - 1] = arguments[i];
                    for (n = n.slice(),
                    i = 0; r = n[i]; ++i)
                        _.call(r, this, o)
                } else
                    switch (arguments.length) {
                    case 1:
                        m.call(n, this);
                        break;
                    case 2:
                        m.call(n, this, arguments[1]);
                        break;
                    case 3:
                        m.call(n, this, arguments[1], arguments[2]);
                        break;
                    default:
                        for (e = arguments.length,
                        o = new Array(e - 1),
                        i = 1; i < e; ++i)
                            o[i - 1] = arguments[i];
                        _.call(n, this, o)
                    }
        }
    },
    h = {
        on: d(n),
        once: d(o),
        off: d(c),
        emit: d(l)
    },
    base = S({}, h),
    t.exports = e = function(t) {
        return null == t ? v(base) : S(Object(t), h)
    }
    ,
    e.methods = f
}
, function(t, e, r) {
    "use strict";
    var n = r(398)
      , o = {
        object: !0,
        symbol: !0
    };
    t.exports = function() {
        var symbol, t = n.Symbol;
        if ("function" != typeof t)
            return !1;
        symbol = t("test symbol");
        try {
            String(symbol)
        } catch (t) {
            return !1
        }
        return !!o[typeof t.iterator] && (!!o[typeof t.toPrimitive] && !!o[typeof t.toStringTag])
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = function() {
        return "object" == typeof globalThis && (!!globalThis && globalThis.Array === Array)
    }
}
, function(t, e) {
    var r = function() {
        if ("object" == typeof self && self)
            return self;
        if ("object" == typeof window && window)
            return window;
        throw new Error("Unable to resolve global `this`")
    };
    t.exports = function() {
        if (this)
            return this;
        try {
            Object.defineProperty(Object.prototype, "__global__", {
                get: function() {
                    return this
                },
                configurable: !0
            })
        } catch (t) {
            return r()
        }
        try {
            return __global__ || r()
        } finally {
            delete Object.prototype.__global__
        }
    }()
}
, function(t, e, r) {
    "use strict";
    var n, o, c, l = r(383), f = r(424), h = r(398).Symbol, d = r(471), y = r(472), _ = r(473), m = Object.create, v = Object.defineProperties, w = Object.defineProperty;
    if ("function" == typeof h)
        try {
            String(h()),
            c = !0
        } catch (t) {}
    else
        h = null;
    o = function(t) {
        if (this instanceof o)
            throw new TypeError("Symbol is not a constructor");
        return n(t)
    }
    ,
    t.exports = n = function t(e) {
        var symbol;
        if (this instanceof t)
            throw new TypeError("Symbol is not a constructor");
        return c ? h(e) : (symbol = m(o.prototype),
        e = void 0 === e ? "" : String(e),
        v(symbol, {
            __description__: l("", e),
            __name__: l("", d(e))
        }))
    }
    ,
    y(n),
    _(n),
    v(o.prototype, {
        constructor: l(n),
        toString: l("", (function() {
            return this.__name__
        }
        ))
    }),
    v(n.prototype, {
        toString: l((function() {
            return "Symbol (" + f(this).__description__ + ")"
        }
        )),
        valueOf: l((function() {
            return f(this)
        }
        ))
    }),
    w(n.prototype, n.toPrimitive, l("", (function() {
        var symbol = f(this);
        return "symbol" == typeof symbol ? symbol : symbol.toString()
    }
    ))),
    w(n.prototype, n.toStringTag, l("c", "Symbol")),
    w(o.prototype, n.toStringTag, l("c", n.prototype[n.toStringTag])),
    w(o.prototype, n.toPrimitive, l("c", n.prototype[n.toPrimitive]))
}
, function(t, e, r) {
    "use strict";
    t.exports = function(t) {
        return !!t && ("symbol" == typeof t || !!t.constructor && ("Symbol" === t.constructor.name && "Symbol" === t[t.constructor.toStringTag]))
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(383)
      , o = Object.create
      , c = Object.defineProperty
      , l = Object.prototype
      , f = o(null);
    t.exports = function(desc) {
        for (var t, e, r = 0; f[desc + (r || "")]; )
            ++r;
        return f[desc += r || ""] = !0,
        c(l, t = "@@" + desc, n.gs(null, (function(r) {
            e || (e = !0,
            c(this, t, n(r)),
            e = !1)
        }
        ))),
        t
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(383)
      , o = r(398).Symbol;
    t.exports = function(t) {
        return Object.defineProperties(t, {
            hasInstance: n("", o && o.hasInstance || t("hasInstance")),
            isConcatSpreadable: n("", o && o.isConcatSpreadable || t("isConcatSpreadable")),
            iterator: n("", o && o.iterator || t("iterator")),
            match: n("", o && o.match || t("match")),
            replace: n("", o && o.replace || t("replace")),
            search: n("", o && o.search || t("search")),
            species: n("", o && o.species || t("species")),
            split: n("", o && o.split || t("split")),
            toPrimitive: n("", o && o.toPrimitive || t("toPrimitive")),
            toStringTag: n("", o && o.toStringTag || t("toStringTag")),
            unscopables: n("", o && o.unscopables || t("unscopables"))
        })
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(383)
      , o = r(424)
      , c = Object.create(null);
    t.exports = function(t) {
        return Object.defineProperties(t, {
            for: n((function(e) {
                return c[e] ? c[e] : c[e] = t(String(e))
            }
            )),
            keyFor: n((function(symbol) {
                var t;
                for (t in o(symbol),
                c)
                    if (c[t] === symbol)
                        return t
            }
            ))
        })
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(399)
      , o = r(392)
      , c = r(400)
      , l = r(386).iterator
      , f = Array.isArray;
    t.exports = function(t) {
        return !!o(t) && (!!f(t) || (!!c(t) || (!!n(t) || "function" == typeof t[l])))
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(399)
      , o = r(389)
      , c = r(400)
      , l = r(476)
      , f = Array.isArray
      , h = Function.prototype.call
      , d = Array.prototype.some;
    t.exports = function(t, e) {
        var r, y, _, m, i, v, w, code, S = arguments[2];
        if (f(t) || n(t) ? r = "array" : c(t) ? r = "string" : t = l(t),
        o(e),
        _ = function() {
            m = !0
        }
        ,
        "array" !== r)
            if ("string" !== r)
                for (y = t.next(); !y.done; ) {
                    if (h.call(e, S, y.value, _),
                    m)
                        return;
                    y = t.next()
                }
            else
                for (v = t.length,
                i = 0; i < v && (w = t[i],
                i + 1 < v && (code = w.charCodeAt(0)) >= 55296 && code <= 56319 && (w += t[++i]),
                h.call(e, S, w, _),
                !m); ++i)
                    ;
        else
            d.call(t, (function(t) {
                return h.call(e, S, t, _),
                m
            }
            ))
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(399)
      , o = r(400)
      , c = r(477)
      , l = r(492)
      , f = r(425)
      , h = r(386).iterator;
    t.exports = function(t) {
        return "function" == typeof f(t)[h] ? t[h]() : n(t) ? new c(t) : o(t) ? new l(t) : new c(t)
    }
}
, function(t, e, r) {
    "use strict";
    var n, o = r(397), c = r(423), l = r(383), f = r(386), h = r(405), d = Object.defineProperty;
    n = t.exports = function(t, e) {
        if (!(this instanceof n))
            throw new TypeError("Constructor requires 'new'");
        h.call(this, t),
        e = e ? c.call(e, "key+value") ? "key+value" : c.call(e, "key") ? "key" : "value" : "value",
        d(this, "__kind__", l("", e))
    }
    ,
    o && o(n, h),
    delete n.prototype.constructor,
    n.prototype = Object.create(h.prototype, {
        _resolve: l((function(i) {
            return "value" === this.__kind__ ? this.__list__[i] : "key+value" === this.__kind__ ? [i, this.__list__[i]] : i
        }
        ))
    }),
    d(n.prototype, f.toStringTag, l("c", "Array Iterator"))
}
, function(t, e, r) {
    "use strict";
    var n, o = r(393), c = r(479), l = r(483), f = r(484), h = r(422), map = r(489), d = Function.prototype.bind, y = Object.defineProperty, _ = Object.prototype.hasOwnProperty;
    n = function(t, desc, e) {
        var r, n = c(desc) && l(desc.value);
        return delete (r = f(desc)).writable,
        delete r.value,
        r.get = function() {
            return !e.overwriteDefinition && _.call(this, t) ? n : (desc.value = d.call(n, e.resolveContext ? e.resolveContext(this) : this),
            y(this, t, desc),
            this[t])
        }
        ,
        r
    }
    ,
    t.exports = function(t) {
        var e = h(arguments[1]);
        return o(e.resolveContext) && l(e.resolveContext),
        map(t, (function(desc, t) {
            return n(t, desc, e)
        }
        ))
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(426)
      , o = r(393);
    t.exports = function(t) {
        return o(t) ? t : n(t, "Cannot use %v", arguments[1])
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(393)
      , o = r(403)
      , c = Object.prototype.toString;
    t.exports = function(t) {
        if (!n(t))
            return null;
        if (o(t)) {
            var e = t.toString;
            if ("function" != typeof e)
                return null;
            if (e === c)
                return null
        }
        try {
            return "" + t
        } catch (t) {
            return null
        }
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(482)
      , o = /[\n\r\u2028\u2029]/g;
    t.exports = function(t) {
        var e = n(t);
        return null === e ? "<Non-coercible to string value>" : (e.length > 100 && (e = e.slice(0, 99) + "��"),
        e = e.replace(o, (function(t) {
            switch (t) {
            case "\n":
                return "\\n";
            case "\r":
                return "\\r";
            case "\u2028":
                return "\\u2028";
            case "\u2029":
                return "\\u2029";
            default:
                throw new Error("Unexpected character")
            }
        }
        )))
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = function(t) {
        try {
            return t.toString()
        } catch (e) {
            try {
                return String(t)
            } catch (t) {
                return null
            }
        }
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(426)
      , o = r(421);
    t.exports = function(t) {
        return o(t) ? t : n(t, "%v is not a plain function", arguments[1])
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(485)
      , o = r(404)
      , c = r(385);
    t.exports = function(t) {
        var e = Object(c(t))
          , r = arguments[1]
          , l = Object(arguments[2]);
        if (e !== t && !r)
            return e;
        var f = {};
        return r ? n(r, (function(e) {
            (l.ensure || e in t) && (f[e] = t[e])
        }
        )) : o(f, t),
        f
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = r(486)() ? Array.from : r(487)
}
, function(t, e, r) {
    "use strict";
    t.exports = function() {
        var t, e, r = Array.from;
        return "function" == typeof r && (e = r(t = ["raz", "dwa"]),
        Boolean(e && e !== t && "dwa" === e[1]))
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(386).iterator
      , o = r(399)
      , c = r(488)
      , l = r(418)
      , f = r(389)
      , h = r(385)
      , d = r(392)
      , y = r(400)
      , _ = Array.isArray
      , m = Function.prototype.call
      , desc = {
        configurable: !0,
        enumerable: !0,
        writable: !0,
        value: null
    }
      , v = Object.defineProperty;
    t.exports = function(t) {
        var e, i, r, w, S, code, E, k, x, I, O = arguments[1], C = arguments[2];
        if (t = Object(h(t)),
        d(O) && f(O),
        this && this !== Array && c(this))
            e = this;
        else {
            if (!O) {
                if (o(t))
                    return 1 !== (S = t.length) ? Array.apply(null, t) : ((w = new Array(1))[0] = t[0],
                    w);
                if (_(t)) {
                    for (w = new Array(S = t.length),
                    i = 0; i < S; ++i)
                        w[i] = t[i];
                    return w
                }
            }
            w = []
        }
        if (!_(t))
            if (void 0 !== (x = t[n])) {
                for (E = f(x).call(t),
                e && (w = new e),
                k = E.next(),
                i = 0; !k.done; )
                    I = O ? m.call(O, C, k.value, i) : k.value,
                    e ? (desc.value = I,
                    v(w, i, desc)) : w[i] = I,
                    k = E.next(),
                    ++i;
                S = i
            } else if (y(t)) {
                for (S = t.length,
                e && (w = new e),
                i = 0,
                r = 0; i < S; ++i)
                    I = t[i],
                    i + 1 < S && (code = I.charCodeAt(0)) >= 55296 && code <= 56319 && (I += t[++i]),
                    I = O ? m.call(O, C, I, r) : I,
                    e ? (desc.value = I,
                    v(w, r, desc)) : w[r] = I,
                    ++r;
                S = r
            }
        if (void 0 === S)
            for (S = l(t.length),
            e && (w = new e(S)),
            i = 0; i < S; ++i)
                I = O ? m.call(O, C, t[i], i) : t[i],
                e ? (desc.value = I,
                v(w, i, desc)) : w[i] = I;
        return e && (desc.value = null,
        w.length = S),
        w
    }
}
, function(t, e, r) {
    "use strict";
    var n = Object.prototype.toString
      , o = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);
    t.exports = function(t) {
        return "function" == typeof t && o(n.call(t))
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(389)
      , o = r(490)
      , c = Function.prototype.call;
    t.exports = function(t, e) {
        var r = {}
          , l = arguments[2];
        return n(e),
        o(t, (function(t, n, o, f) {
            r[n] = c.call(e, l, t, n, o, f)
        }
        )),
        r
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = r(491)("forEach")
}
, function(t, e, r) {
    "use strict";
    var n = r(389)
      , o = r(385)
      , c = Function.prototype.bind
      , l = Function.prototype.call
      , f = Object.keys
      , h = Object.prototype.propertyIsEnumerable;
    t.exports = function(t, e) {
        return function(r, d) {
            var y, _ = arguments[2], m = arguments[3];
            return r = Object(o(r)),
            n(d),
            y = f(r),
            m && y.sort("function" == typeof m ? c.call(m, r) : void 0),
            "function" != typeof t && (t = y[t]),
            l.call(t, y, (function(t, n) {
                return h.call(r, t) ? l.call(d, _, r[t], t, r, n) : e
            }
            ))
        }
    }
}
, function(t, e, r) {
    "use strict";
    var n, o = r(397), c = r(383), l = r(386), f = r(405), h = Object.defineProperty;
    n = t.exports = function(t) {
        if (!(this instanceof n))
            throw new TypeError("Constructor requires 'new'");
        t = String(t),
        f.call(this, t),
        h(this, "__length__", c("", t.length))
    }
    ,
    o && o(n, f),
    delete n.prototype.constructor,
    n.prototype = Object.create(f.prototype, {
        _next: c((function() {
            if (this.__list__)
                return this.__nextIndex__ < this.__length__ ? this.__nextIndex__++ : void this._unBind()
        }
        )),
        _resolve: c((function(i) {
            var code, t = this.__list__[i];
            return this.__nextIndex__ === this.__length__ ? t : (code = t.charCodeAt(0)) >= 55296 && code <= 56319 ? t + this.__list__[this.__nextIndex__++] : t
        }
        ))
    }),
    h(n.prototype, l.toStringTag, c("c", "String Iterator"))
}
, function(t, e, r) {
    "use strict";
    var n, o = r(397), c = r(383), l = r(405), f = r(386).toStringTag, h = r(494), d = Object.defineProperties, y = l.prototype._unBind;
    n = t.exports = function(map, t) {
        if (!(this instanceof n))
            return new n(map,t);
        l.call(this, map.__mapKeysData__, map),
        t && h[t] || (t = "key+value"),
        d(this, {
            __kind__: c("", t),
            __values__: c("w", map.__mapValuesData__)
        })
    }
    ,
    o && o(n, l),
    n.prototype = Object.create(l.prototype, {
        constructor: c(n),
        _resolve: c((function(i) {
            return "value" === this.__kind__ ? this.__values__[i] : "key" === this.__kind__ ? this.__list__[i] : [this.__list__[i], this.__values__[i]]
        }
        )),
        _unBind: c((function() {
            this.__values__ = null,
            y.call(this)
        }
        )),
        toString: c((function() {
            return "[object Map Iterator]"
        }
        ))
    }),
    Object.defineProperty(n.prototype, f, c("c", "Map Iterator"))
}
, function(t, e, r) {
    "use strict";
    t.exports = r(495)("key", "value", "key+value")
}
, function(t, e, r) {
    "use strict";
    var n = Array.prototype.forEach
      , o = Object.create;
    t.exports = function(t) {
        var e = o(null);
        return n.call(arguments, (function(t) {
            e[t] = !0
        }
        )),
        e
    }
}
, function(t, e, r) {
    "use strict";
    t.exports = "undefined" != typeof Map && "[object Map]" === Object.prototype.toString.call(new Map)
}
, function(t, e, r) {
    "use strict";
    e.parser = r(498),
    e.generate = r(507),
    e.writeToStream = r(429)
}
, function(t, e, r) {
    "use strict";
    var n = r(499)
      , o = r(384)
      , c = r(394).EventEmitter
      , l = r(504)
      , f = r(427)
      , h = r(428)("mqtt-packet:parser");
    function d(t) {
        if (!(this instanceof d))
            return new d(t);
        this.settings = t || {},
        this._states = ["_parseHeader", "_parseLength", "_parsePayload", "_newPacket"],
        this._resetState()
    }
    o(d, c),
    d.prototype._resetState = function() {
        h("_resetState: resetting packet, error, _list, and _stateCounter"),
        this.packet = new l,
        this.error = null,
        this._list = n(),
        this._stateCounter = 0
    }
    ,
    d.prototype.parse = function(t) {
        for (this.error && this._resetState(),
        this._list.append(t),
        h("parse: current state: %s", this._states[this._stateCounter]); (-1 !== this.packet.length || this._list.length > 0) && this[this._states[this._stateCounter]]() && !this.error; )
            this._stateCounter++,
            h("parse: state complete. _stateCounter is now: %d", this._stateCounter),
            h("parse: packet.length: %d, buffer list length: %d", this.packet.length, this._list.length),
            this._stateCounter >= this._states.length && (this._stateCounter = 0);
        return h("parse: exited while loop. packet: %d, buffer list length: %d", this.packet.length, this._list.length),
        this._list.length
    }
    ,
    d.prototype._parseHeader = function() {
        var t = this._list.readUInt8(0);
        return this.packet.cmd = f.types[t >> f.CMD_SHIFT],
        this.packet.retain = 0 != (t & f.RETAIN_MASK),
        this.packet.qos = t >> f.QOS_SHIFT & f.QOS_MASK,
        this.packet.dup = 0 != (t & f.DUP_MASK),
        h("_parseHeader: packet: %o", this.packet),
        this._list.consume(1),
        !0
    }
    ,
    d.prototype._parseLength = function() {
        var t = this._parseVarByteNum(!0);
        return t && (this.packet.length = t.value,
        this._list.consume(t.bytes)),
        h("_parseLength %d", t.value),
        !!t
    }
    ,
    d.prototype._parsePayload = function() {
        h("_parsePayload: payload %O", this._list);
        var t = !1;
        if (0 === this.packet.length || this._list.length >= this.packet.length) {
            switch (this._pos = 0,
            this.packet.cmd) {
            case "connect":
                this._parseConnect();
                break;
            case "connack":
                this._parseConnack();
                break;
            case "publish":
                this._parsePublish();
                break;
            case "puback":
            case "pubrec":
            case "pubrel":
            case "pubcomp":
                this._parseConfirmation();
                break;
            case "subscribe":
                this._parseSubscribe();
                break;
            case "suback":
                this._parseSuback();
                break;
            case "unsubscribe":
                this._parseUnsubscribe();
                break;
            case "unsuback":
                this._parseUnsuback();
                break;
            case "pingreq":
            case "pingresp":
                break;
            case "disconnect":
                this._parseDisconnect();
                break;
            case "auth":
                this._parseAuth();
                break;
            default:
                this._emitError(new Error("Not supported"))
            }
            t = !0
        }
        return h("_parsePayload complete result: %s", t),
        t
    }
    ,
    d.prototype._parseConnect = function() {
        var t, e, r, n, o, c;
        h("_parseConnect");
        var l = {}
          , d = this.packet;
        if (null === (t = this._parseString()))
            return this._emitError(new Error("Cannot parse protocolId"));
        if ("MQTT" !== t && "MQIsdp" !== t)
            return this._emitError(new Error("Invalid protocolId"));
        if (d.protocolId = t,
        this._pos >= this._list.length)
            return this._emitError(new Error("Packet too short"));
        if (d.protocolVersion = this._list.readUInt8(this._pos),
        3 !== d.protocolVersion && 4 !== d.protocolVersion && 5 !== d.protocolVersion)
            return this._emitError(new Error("Invalid protocol version"));
        if (this._pos++,
        this._pos >= this._list.length)
            return this._emitError(new Error("Packet too short"));
        if (l.username = this._list.readUInt8(this._pos) & f.USERNAME_MASK,
        l.password = this._list.readUInt8(this._pos) & f.PASSWORD_MASK,
        l.will = this._list.readUInt8(this._pos) & f.WILL_FLAG_MASK,
        l.will && (d.will = {},
        d.will.retain = 0 != (this._list.readUInt8(this._pos) & f.WILL_RETAIN_MASK),
        d.will.qos = (this._list.readUInt8(this._pos) & f.WILL_QOS_MASK) >> f.WILL_QOS_SHIFT),
        d.clean = 0 != (this._list.readUInt8(this._pos) & f.CLEAN_SESSION_MASK),
        this._pos++,
        d.keepalive = this._parseNum(),
        -1 === d.keepalive)
            return this._emitError(new Error("Packet too short"));
        if (5 === d.protocolVersion) {
            var y = this._parseProperties();
            Object.getOwnPropertyNames(y).length && (d.properties = y)
        }
        if (null === (e = this._parseString()))
            return this._emitError(new Error("Packet too short"));
        if (d.clientId = e,
        h("_parseConnect: packet.clientId: %s", d.clientId),
        l.will) {
            if (5 === d.protocolVersion) {
                var _ = this._parseProperties();
                Object.getOwnPropertyNames(_).length && (d.will.properties = _)
            }
            if (null === (r = this._parseString()))
                return this._emitError(new Error("Cannot parse will topic"));
            if (d.will.topic = r,
            h("_parseConnect: packet.will.topic: %s", d.will.topic),
            null === (n = this._parseBuffer()))
                return this._emitError(new Error("Cannot parse will payload"));
            d.will.payload = n,
            h("_parseConnect: packet.will.paylaod: %s", d.will.payload)
        }
        if (l.username) {
            if (null === (c = this._parseString()))
                return this._emitError(new Error("Cannot parse username"));
            d.username = c,
            h("_parseConnect: packet.username: %s", d.username)
        }
        if (l.password) {
            if (null === (o = this._parseBuffer()))
                return this._emitError(new Error("Cannot parse password"));
            d.password = o
        }
        return this.settings = d,
        h("_parseConnect: complete"),
        d
    }
    ,
    d.prototype._parseConnack = function() {
        h("_parseConnack");
        var t = this.packet;
        if (this._list.length < 2)
            return null;
        if (t.sessionPresent = !!(this._list.readUInt8(this._pos++) & f.SESSIONPRESENT_MASK),
        5 === this.settings.protocolVersion ? t.reasonCode = this._list.readUInt8(this._pos++) : t.returnCode = this._list.readUInt8(this._pos++),
        -1 === t.returnCode || -1 === t.reasonCode)
            return this._emitError(new Error("Cannot parse return code"));
        if (5 === this.settings.protocolVersion) {
            var e = this._parseProperties();
            Object.getOwnPropertyNames(e).length && (t.properties = e)
        }
        h("_parseConnack: complete")
    }
    ,
    d.prototype._parsePublish = function() {
        h("_parsePublish");
        var t = this.packet;
        if (t.topic = this._parseString(),
        null === t.topic)
            return this._emitError(new Error("Cannot parse topic"));
        if (!(t.qos > 0) || this._parseMessageId()) {
            if (5 === this.settings.protocolVersion) {
                var e = this._parseProperties();
                Object.getOwnPropertyNames(e).length && (t.properties = e)
            }
            t.payload = this._list.slice(this._pos, t.length),
            h("_parsePublish: payload from buffer list: %o", t.payload)
        }
    }
    ,
    d.prototype._parseSubscribe = function() {
        h("_parseSubscribe");
        var t, e, r, n, o, c, l, d = this.packet;
        if (1 !== d.qos)
            return this._emitError(new Error("Wrong subscribe header"));
        if (d.subscriptions = [],
        this._parseMessageId()) {
            if (5 === this.settings.protocolVersion) {
                var y = this._parseProperties();
                Object.getOwnPropertyNames(y).length && (d.properties = y)
            }
            for (; this._pos < d.length; ) {
                if (null === (t = this._parseString()))
                    return this._emitError(new Error("Cannot parse topic"));
                if (this._pos >= d.length)
                    return this._emitError(new Error("Malformed Subscribe Payload"));
                r = (e = this._parseByte()) & f.SUBSCRIBE_OPTIONS_QOS_MASK,
                c = 0 != (e >> f.SUBSCRIBE_OPTIONS_NL_SHIFT & f.SUBSCRIBE_OPTIONS_NL_MASK),
                o = 0 != (e >> f.SUBSCRIBE_OPTIONS_RAP_SHIFT & f.SUBSCRIBE_OPTIONS_RAP_MASK),
                n = e >> f.SUBSCRIBE_OPTIONS_RH_SHIFT & f.SUBSCRIBE_OPTIONS_RH_MASK,
                l = {
                    topic: t,
                    qos: r
                },
                5 === this.settings.protocolVersion && (l.nl = c,
                l.rap = o,
                l.rh = n),
                h("_parseSubscribe: push subscription `%s` to subscription", l),
                d.subscriptions.push(l)
            }
        }
    }
    ,
    d.prototype._parseSuback = function() {
        h("_parseSuback");
        var t = this.packet;
        if (this.packet.granted = [],
        this._parseMessageId()) {
            if (5 === this.settings.protocolVersion) {
                var e = this._parseProperties();
                Object.getOwnPropertyNames(e).length && (t.properties = e)
            }
            for (; this._pos < this.packet.length; )
                this.packet.granted.push(this._list.readUInt8(this._pos++))
        }
    }
    ,
    d.prototype._parseUnsubscribe = function() {
        h("_parseUnsubscribe");
        var t = this.packet;
        if (t.unsubscriptions = [],
        this._parseMessageId()) {
            if (5 === this.settings.protocolVersion) {
                var e = this._parseProperties();
                Object.getOwnPropertyNames(e).length && (t.properties = e)
            }
            for (; this._pos < t.length; ) {
                var r;
                if (null === (r = this._parseString()))
                    return this._emitError(new Error("Cannot parse topic"));
                h("_parseUnsubscribe: push topic `%s` to unsubscriptions", r),
                t.unsubscriptions.push(r)
            }
        }
    }
    ,
    d.prototype._parseUnsuback = function() {
        h("_parseUnsuback");
        var t = this.packet;
        if (!this._parseMessageId())
            return this._emitError(new Error("Cannot parse messageId"));
        if (5 === this.settings.protocolVersion) {
            var e = this._parseProperties();
            for (Object.getOwnPropertyNames(e).length && (t.properties = e),
            t.granted = []; this._pos < this.packet.length; )
                this.packet.granted.push(this._list.readUInt8(this._pos++))
        }
    }
    ,
    d.prototype._parseConfirmation = function() {
        h("_parseConfirmation: packet.cmd: `%s`", this.packet.cmd);
        var t = this.packet;
        if (this._parseMessageId(),
        5 === this.settings.protocolVersion && (t.length > 2 && (t.reasonCode = this._parseByte(),
        h("_parseConfirmation: packet.reasonCode `%d`", t.reasonCode)),
        t.length > 3)) {
            var e = this._parseProperties();
            Object.getOwnPropertyNames(e).length && (t.properties = e)
        }
        return !0
    }
    ,
    d.prototype._parseDisconnect = function() {
        var t = this.packet;
        if (h("_parseDisconnect"),
        5 === this.settings.protocolVersion) {
            t.reasonCode = this._parseByte();
            var e = this._parseProperties();
            Object.getOwnPropertyNames(e).length && (t.properties = e)
        }
        return h("_parseDisconnect result: true"),
        !0
    }
    ,
    d.prototype._parseAuth = function() {
        h("_parseAuth");
        var t = this.packet;
        if (5 !== this.settings.protocolVersion)
            return this._emitError(new Error("Not supported auth packet for this version MQTT"));
        t.reasonCode = this._parseByte();
        var e = this._parseProperties();
        return Object.getOwnPropertyNames(e).length && (t.properties = e),
        h("_parseAuth: result: true"),
        !0
    }
    ,
    d.prototype._parseMessageId = function() {
        var t = this.packet;
        return t.messageId = this._parseNum(),
        null === t.messageId ? (this._emitError(new Error("Cannot parse messageId")),
        !1) : (h("_parseMessageId: packet.messageId %d", t.messageId),
        !0)
    }
    ,
    d.prototype._parseString = function(t) {
        var e, r = this._parseNum(), n = r + this._pos;
        return -1 === r || n > this._list.length || n > this.packet.length ? null : (e = this._list.toString("utf8", this._pos, n),
        this._pos += r,
        h("_parseString: result: %s", e),
        e)
    }
    ,
    d.prototype._parseStringPair = function() {
        return h("_parseStringPair"),
        {
            name: this._parseString(),
            value: this._parseString()
        }
    }
    ,
    d.prototype._parseBuffer = function() {
        var t, e = this._parseNum(), r = e + this._pos;
        return -1 === e || r > this._list.length || r > this.packet.length ? null : (t = this._list.slice(this._pos, r),
        this._pos += e,
        h("_parseBuffer: result: %o", t),
        t)
    }
    ,
    d.prototype._parseNum = function() {
        if (this._list.length - this._pos < 2)
            return -1;
        var t = this._list.readUInt16BE(this._pos);
        return this._pos += 2,
        h("_parseNum: result: %s", t),
        t
    }
    ,
    d.prototype._parse4ByteNum = function() {
        if (this._list.length - this._pos < 4)
            return -1;
        var t = this._list.readUInt32BE(this._pos);
        return this._pos += 4,
        h("_parse4ByteNum: result: %s", t),
        t
    }
    ,
    d.prototype._parseVarByteNum = function(t) {
        h("_parseVarByteNum");
        for (var e, r = 0, n = 1, o = 0, c = !0, l = this._pos ? this._pos : 0; r < 5 && (o += n * ((e = this._list.readUInt8(l + r++)) & f.LENGTH_MASK),
        n *= 128,
        0 != (e & f.LENGTH_FIN_MASK)); )
            if (this._list.length <= r) {
                c = !1;
                break
            }
        return l && (this._pos += r),
        h("_parseVarByteNum: result: %o", c = !!c && (t ? {
            bytes: r,
            value: o
        } : o)),
        c
    }
    ,
    d.prototype._parseByte = function() {
        var t = this._list.readUInt8(this._pos);
        return this._pos++,
        h("_parseByte: result: %o", t),
        t
    }
    ,
    d.prototype._parseByType = function(t) {
        switch (h("_parseByType: type: %s", t),
        t) {
        case "byte":
            return 0 !== this._parseByte();
        case "int8":
            return this._parseByte();
        case "int16":
            return this._parseNum();
        case "int32":
            return this._parse4ByteNum();
        case "var":
            return this._parseVarByteNum();
        case "string":
            return this._parseString();
        case "pair":
            return this._parseStringPair();
        case "binary":
            return this._parseBuffer()
        }
    }
    ,
    d.prototype._parseProperties = function() {
        h("_parseProperties");
        for (var t = this._parseVarByteNum(), e = this._pos + t, r = {}; this._pos < e; ) {
            var n = this._parseByte()
              , o = f.propertiesCodes[n];
            if (!o)
                return this._emitError(new Error("Unknown property")),
                !1;
            if ("userProperties" !== o)
                r[o] ? (Array.isArray(r[o]) || (r[o] = [r[o]]),
                r[o].push(this._parseByType(f.propertiesTypes[o]))) : r[o] = this._parseByType(f.propertiesTypes[o]);
            else {
                r[o] || (r[o] = {});
                var c = this._parseByType(f.propertiesTypes[o]);
                if (r[o][c.name])
                    if (Array.isArray(r[o][c.name]))
                        r[o][c.name].push(c.value);
                    else {
                        var l = r[o][c.name];
                        r[o][c.name] = [l],
                        r[o][c.name].push(c.value)
                    }
                else
                    r[o][c.name] = c.value
            }
        }
        return r
    }
    ,
    d.prototype._newPacket = function() {
        return h("_newPacket"),
        this.packet && (this._list.consume(this.packet.length),
        h("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d", this.packet.cmd, this.packet.payload, this.packet.length),
        this.emit("packet", this.packet)),
        h("_newPacket: new packet"),
        this.packet = new l,
        this._pos = 0,
        !0
    }
    ,
    d.prototype._emitError = function(t) {
        h("_emitError"),
        this.error = t,
        this.emit("error", t)
    }
    ,
    t.exports = d
}
, function(t, e, r) {
    var n = r(500)
      , o = r(501)
      , c = r(388).Buffer;
    function l(t) {
        if (!(this instanceof l))
            return new l(t);
        if (this._bufs = [],
        this.length = 0,
        "function" == typeof t) {
            this._callback = t;
            var e = function(t) {
                this._callback && (this._callback(t),
                this._callback = null)
            }
            .bind(this);
            this.on("pipe", (function(t) {
                t.on("error", e)
            }
            )),
            this.on("unpipe", (function(t) {
                t.removeListener("error", e)
            }
            ))
        } else
            this.append(t);
        n.call(this)
    }
    o.inherits(l, n),
    l.prototype._offset = function(t) {
        var e, r = 0, i = 0;
        if (0 === t)
            return [0, 0];
        for (; i < this._bufs.length; i++) {
            if (t < (e = r + this._bufs[i].length) || i == this._bufs.length - 1)
                return [i, t - r];
            r = e
        }
    }
    ,
    l.prototype.append = function(t) {
        var i = 0;
        if (c.isBuffer(t))
            this._appendBuffer(t);
        else if (Array.isArray(t))
            for (; i < t.length; i++)
                this.append(t[i]);
        else if (t instanceof l)
            for (; i < t._bufs.length; i++)
                this.append(t._bufs[i]);
        else
            null != t && ("number" == typeof t && (t = t.toString()),
            this._appendBuffer(c.from(t)));
        return this
    }
    ,
    l.prototype._appendBuffer = function(t) {
        this._bufs.push(t),
        this.length += t.length
    }
    ,
    l.prototype._write = function(t, e, r) {
        this._appendBuffer(t),
        "function" == typeof r && r()
    }
    ,
    l.prototype._read = function(t) {
        if (!this.length)
            return this.push(null);
        t = Math.min(t, this.length),
        this.push(this.slice(0, t)),
        this.consume(t)
    }
    ,
    l.prototype.end = function(t) {
        n.prototype.end.call(this, t),
        this._callback && (this._callback(null, this.slice()),
        this._callback = null)
    }
    ,
    l.prototype.get = function(t) {
        return this.slice(t, t + 1)[0]
    }
    ,
    l.prototype.slice = function(t, e) {
        return "number" == typeof t && t < 0 && (t += this.length),
        "number" == typeof e && e < 0 && (e += this.length),
        this.copy(null, 0, t, e)
    }
    ,
    l.prototype.copy = function(t, e, r, n) {
        if (("number" != typeof r || r < 0) && (r = 0),
        ("number" != typeof n || n > this.length) && (n = this.length),
        r >= this.length)
            return t || c.alloc(0);
        if (n <= 0)
            return t || c.alloc(0);
        var o, i, l = !!t, f = this._offset(r), h = n - r, d = h, y = l && e || 0, _ = f[1];
        if (0 === r && n == this.length) {
            if (!l)
                return 1 === this._bufs.length ? this._bufs[0] : c.concat(this._bufs, this.length);
            for (i = 0; i < this._bufs.length; i++)
                this._bufs[i].copy(t, y),
                y += this._bufs[i].length;
            return t
        }
        if (d <= this._bufs[f[0]].length - _)
            return l ? this._bufs[f[0]].copy(t, e, _, _ + d) : this._bufs[f[0]].slice(_, _ + d);
        for (l || (t = c.allocUnsafe(h)),
        i = f[0]; i < this._bufs.length; i++) {
            if (!(d > (o = this._bufs[i].length - _))) {
                this._bufs[i].copy(t, y, _, _ + d);
                break
            }
            this._bufs[i].copy(t, y, _),
            y += o,
            d -= o,
            _ && (_ = 0)
        }
        return t
    }
    ,
    l.prototype.shallowSlice = function(t, e) {
        t = t || 0,
        e = e || this.length,
        t < 0 && (t += this.length),
        e < 0 && (e += this.length);
        var r = this._offset(t)
          , n = this._offset(e)
          , o = this._bufs.slice(r[0], n[0] + 1);
        return 0 == n[1] ? o.pop() : o[o.length - 1] = o[o.length - 1].slice(0, n[1]),
        0 != r[1] && (o[0] = o[0].slice(r[1])),
        new l(o)
    }
    ,
    l.prototype.toString = function(t, e, r) {
        return this.slice(e, r).toString(t)
    }
    ,
    l.prototype.consume = function(t) {
        for (; this._bufs.length; ) {
            if (!(t >= this._bufs[0].length)) {
                this._bufs[0] = this._bufs[0].slice(t),
                this.length -= t;
                break
            }
            t -= this._bufs[0].length,
            this.length -= this._bufs[0].length,
            this._bufs.shift()
        }
        return this
    }
    ,
    l.prototype.duplicate = function() {
        for (var i = 0, t = new l; i < this._bufs.length; i++)
            t.append(this._bufs[i]);
        return t
    }
    ,
    l.prototype.destroy = function() {
        this._bufs.length = 0,
        this.length = 0,
        this.push(null)
    }
    ,
    function() {
        var t = {
            readDoubleBE: 8,
            readDoubleLE: 8,
            readFloatBE: 4,
            readFloatLE: 4,
            readInt32BE: 4,
            readInt32LE: 4,
            readUInt32BE: 4,
            readUInt32LE: 4,
            readInt16BE: 2,
            readInt16LE: 2,
            readUInt16BE: 2,
            readUInt16LE: 2,
            readInt8: 1,
            readUInt8: 1
        };
        for (var e in t)
            !function(e) {
                l.prototype[e] = function(r) {
                    return this.slice(r, r + t[e])[e](0)
                }
            }(e)
    }(),
    t.exports = l
}
, function(t, e, r) {
    t.exports = r(387)
}
, function(t, e, r) {
    (function(t) {
        var n = Object.getOwnPropertyDescriptors || function(t) {
            for (var e = Object.keys(t), r = {}, i = 0; i < e.length; i++)
                r[e[i]] = Object.getOwnPropertyDescriptor(t, e[i]);
            return r
        }
          , o = /%[sdj%]/g;
        e.format = function(t) {
            if (!k(t)) {
                for (var e = [], i = 0; i < arguments.length; i++)
                    e.push(f(arguments[i]));
                return e.join(" ")
            }
            i = 1;
            for (var r = arguments, n = r.length, c = String(t).replace(o, (function(t) {
                if ("%%" === t)
                    return "%";
                if (i >= n)
                    return t;
                switch (t) {
                case "%s":
                    return String(r[i++]);
                case "%d":
                    return Number(r[i++]);
                case "%j":
                    try {
                        return JSON.stringify(r[i++])
                    } catch (t) {
                        return "[Circular]"
                    }
                default:
                    return t
                }
            }
            )), l = r[i]; i < n; l = r[++i])
                S(l) || !O(l) ? c += " " + l : c += " " + f(l);
            return c
        }
        ,
        e.deprecate = function(r, n) {
            if (void 0 !== t && !0 === t.noDeprecation)
                return r;
            if (void 0 === t)
                return function() {
                    return e.deprecate(r, n).apply(this, arguments)
                }
                ;
            var o = !1;
            return function() {
                if (!o) {
                    if (t.throwDeprecation)
                        throw new Error(n);
                    t.traceDeprecation ? console.trace(n) : console.error(n),
                    o = !0
                }
                return r.apply(this, arguments)
            }
        }
        ;
        var c, l = {};
        function f(t, r) {
            var n = {
                seen: [],
                stylize: d
            };
            return arguments.length >= 3 && (n.depth = arguments[2]),
            arguments.length >= 4 && (n.colors = arguments[3]),
            w(r) ? n.showHidden = r : r && e._extend(n, r),
            x(n.showHidden) && (n.showHidden = !1),
            x(n.depth) && (n.depth = 2),
            x(n.colors) && (n.colors = !1),
            x(n.customInspect) && (n.customInspect = !0),
            n.colors && (n.stylize = h),
            y(n, t, n.depth)
        }
        function h(t, e) {
            var style = f.styles[e];
            return style ? "[" + f.colors[style][0] + "m" + t + "[" + f.colors[style][1] + "m" : t
        }
        function d(t, e) {
            return t
        }
        function y(t, r, n) {
            if (t.customInspect && r && P(r.inspect) && r.inspect !== e.inspect && (!r.constructor || r.constructor.prototype !== r)) {
                var o = r.inspect(n, t);
                return k(o) || (o = y(t, o, n)),
                o
            }
            var c = function(t, e) {
                if (x(e))
                    return t.stylize("undefined", "undefined");
                if (k(e)) {
                    var r = "'" + JSON.stringify(e).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
                    return t.stylize(r, "string")
                }
                if (E(e))
                    return t.stylize("" + e, "number");
                if (w(e))
                    return t.stylize("" + e, "boolean");
                if (S(e))
                    return t.stylize("null", "null")
            }(t, r);
            if (c)
                return c;
            var l = Object.keys(r)
              , f = function(t) {
                var e = {};
                return t.forEach((function(t, r) {
                    e[t] = !0
                }
                )),
                e
            }(l);
            if (t.showHidden && (l = Object.getOwnPropertyNames(r)),
            A(r) && (l.indexOf("message") >= 0 || l.indexOf("description") >= 0))
                return _(r);
            if (0 === l.length) {
                if (P(r)) {
                    var h = r.name ? ": " + r.name : "";
                    return t.stylize("[Function" + h + "]", "special")
                }
                if (I(r))
                    return t.stylize(RegExp.prototype.toString.call(r), "regexp");
                if (C(r))
                    return t.stylize(Date.prototype.toString.call(r), "date");
                if (A(r))
                    return _(r)
            }
            var output, base = "", d = !1, O = ["{", "}"];
            (v(r) && (d = !0,
            O = ["[", "]"]),
            P(r)) && (base = " [Function" + (r.name ? ": " + r.name : "") + "]");
            return I(r) && (base = " " + RegExp.prototype.toString.call(r)),
            C(r) && (base = " " + Date.prototype.toUTCString.call(r)),
            A(r) && (base = " " + _(r)),
            0 !== l.length || d && 0 != r.length ? n < 0 ? I(r) ? t.stylize(RegExp.prototype.toString.call(r), "regexp") : t.stylize("[Object]", "special") : (t.seen.push(r),
            output = d ? function(t, e, r, n, o) {
                for (var output = [], i = 0, c = e.length; i < c; ++i)
                    B(e, String(i)) ? output.push(m(t, e, r, n, String(i), !0)) : output.push("");
                return o.forEach((function(o) {
                    o.match(/^\d+$/) || output.push(m(t, e, r, n, o, !0))
                }
                )),
                output
            }(t, r, n, f, l) : l.map((function(e) {
                return m(t, r, n, f, e, d)
            }
            )),
            t.seen.pop(),
            function(output, base, t) {
                if (output.reduce((function(t, e) {
                    return e.indexOf("\n") >= 0 && 0,
                    t + e.replace(/\u001b\[\d\d?m/g, "").length + 1
                }
                ), 0) > 60)
                    return t[0] + ("" === base ? "" : base + "\n ") + " " + output.join(",\n  ") + " " + t[1];
                return t[0] + base + " " + output.join(", ") + " " + t[1]
            }(output, base, O)) : O[0] + base + O[1]
        }
        function _(t) {
            return "[" + Error.prototype.toString.call(t) + "]"
        }
        function m(t, e, r, n, o, c) {
            var l, f, desc;
            if ((desc = Object.getOwnPropertyDescriptor(e, o) || {
                value: e[o]
            }).get ? f = desc.set ? t.stylize("[Getter/Setter]", "special") : t.stylize("[Getter]", "special") : desc.set && (f = t.stylize("[Setter]", "special")),
            B(n, o) || (l = "[" + o + "]"),
            f || (t.seen.indexOf(desc.value) < 0 ? (f = S(r) ? y(t, desc.value, null) : y(t, desc.value, r - 1)).indexOf("\n") > -1 && (f = c ? f.split("\n").map((function(line) {
                return "  " + line
            }
            )).join("\n").substr(2) : "\n" + f.split("\n").map((function(line) {
                return "   " + line
            }
            )).join("\n")) : f = t.stylize("[Circular]", "special")),
            x(l)) {
                if (c && o.match(/^\d+$/))
                    return f;
                (l = JSON.stringify("" + o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (l = l.substr(1, l.length - 2),
                l = t.stylize(l, "name")) : (l = l.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"),
                l = t.stylize(l, "string"))
            }
            return l + ": " + f
        }
        function v(t) {
            return Array.isArray(t)
        }
        function w(t) {
            return "boolean" == typeof t
        }
        function S(t) {
            return null === t
        }
        function E(t) {
            return "number" == typeof t
        }
        function k(t) {
            return "string" == typeof t
        }
        function x(t) {
            return void 0 === t
        }
        function I(t) {
            return O(t) && "[object RegExp]" === T(t)
        }
        function O(t) {
            return "object" == typeof t && null !== t
        }
        function C(t) {
            return O(t) && "[object Date]" === T(t)
        }
        function A(t) {
            return O(t) && ("[object Error]" === T(t) || t instanceof Error)
        }
        function P(t) {
            return "function" == typeof t
        }
        function T(t) {
            return Object.prototype.toString.call(t)
        }
        function j(t) {
            return t < 10 ? "0" + t.toString(10) : t.toString(10)
        }
        e.debuglog = function(r) {
            if (x(c) && (c = t.env.NODE_DEBUG || ""),
            r = r.toUpperCase(),
            !l[r])
                if (new RegExp("\\b" + r + "\\b","i").test(c)) {
                    var n = t.pid;
                    l[r] = function() {
                        var t = e.format.apply(e, arguments);
                        console.error("%s %d: %s", r, n, t)
                    }
                } else
                    l[r] = function() {}
                    ;
            return l[r]
        }
        ,
        e.inspect = f,
        f.colors = {
            bold: [1, 22],
            italic: [3, 23],
            underline: [4, 24],
            inverse: [7, 27],
            white: [37, 39],
            grey: [90, 39],
            black: [30, 39],
            blue: [34, 39],
            cyan: [36, 39],
            green: [32, 39],
            magenta: [35, 39],
            red: [31, 39],
            yellow: [33, 39]
        },
        f.styles = {
            special: "cyan",
            number: "yellow",
            boolean: "yellow",
            undefined: "grey",
            null: "bold",
            string: "green",
            date: "magenta",
            regexp: "red"
        },
        e.isArray = v,
        e.isBoolean = w,
        e.isNull = S,
        e.isNullOrUndefined = function(t) {
            return null == t
        }
        ,
        e.isNumber = E,
        e.isString = k,
        e.isSymbol = function(t) {
            return "symbol" == typeof t
        }
        ,
        e.isUndefined = x,
        e.isRegExp = I,
        e.isObject = O,
        e.isDate = C,
        e.isError = A,
        e.isFunction = P,
        e.isPrimitive = function(t) {
            return null === t || "boolean" == typeof t || "number" == typeof t || "string" == typeof t || "symbol" == typeof t || void 0 === t
        }
        ,
        e.isBuffer = r(502);
        var R = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
        function M() {
            var t = new Date
              , time = [j(t.getHours()), j(t.getMinutes()), j(t.getSeconds())].join(":");
            return [t.getDate(), R[t.getMonth()], time].join(" ")
        }
        function B(t, e) {
            return Object.prototype.hasOwnProperty.call(t, e)
        }
        e.log = function() {
            console.log("%s - %s", M(), e.format.apply(e, arguments))
        }
        ,
        e.inherits = r(503),
        e._extend = function(t, e) {
            if (!e || !O(e))
                return t;
            for (var r = Object.keys(e), i = r.length; i--; )
                t[r[i]] = e[r[i]];
            return t
        }
        ;
        var N = "undefined" != typeof Symbol ? Symbol("util.promisify.custom") : void 0;
        function U(t, e) {
            if (!t) {
                var r = new Error("Promise was rejected with a falsy value");
                r.reason = t,
                t = r
            }
            return e(t)
        }
        e.promisify = function(t) {
            if ("function" != typeof t)
                throw new TypeError('The "original" argument must be of type Function');
            if (N && t[N]) {
                var e;
                if ("function" != typeof (e = t[N]))
                    throw new TypeError('The "util.promisify.custom" argument must be of type Function');
                return Object.defineProperty(e, N, {
                    value: e,
                    enumerable: !1,
                    writable: !1,
                    configurable: !0
                }),
                e
            }
            function e() {
                for (var e, r, n = new Promise((function(t, n) {
                    e = t,
                    r = n
                }
                )), o = [], i = 0; i < arguments.length; i++)
                    o.push(arguments[i]);
                o.push((function(t, n) {
                    t ? r(t) : e(n)
                }
                ));
                try {
                    t.apply(this, o)
                } catch (t) {
                    r(t)
                }
                return n
            }
            return Object.setPrototypeOf(e, Object.getPrototypeOf(t)),
            N && Object.defineProperty(e, N, {
                value: e,
                enumerable: !1,
                writable: !1,
                configurable: !0
            }),
            Object.defineProperties(e, n(t))
        }
        ,
        e.promisify.custom = N,
        e.callbackify = function(e) {
            if ("function" != typeof e)
                throw new TypeError('The "original" argument must be of type Function');
            function r() {
                for (var r = [], i = 0; i < arguments.length; i++)
                    r.push(arguments[i]);
                var n = r.pop();
                if ("function" != typeof n)
                    throw new TypeError("The last argument must be of type Function");
                var o = this
                  , c = function() {
                    return n.apply(o, arguments)
                };
                e.apply(this, r).then((function(e) {
                    t.nextTick(c, null, e)
                }
                ), (function(e) {
                    t.nextTick(U, e, c)
                }
                ))
            }
            return Object.setPrototypeOf(r, Object.getPrototypeOf(e)),
            Object.defineProperties(r, n(e)),
            r
        }
    }
    ).call(this, r(147))
}
, function(t, e) {
    t.exports = function(t) {
        return t && "object" == typeof t && "function" == typeof t.copy && "function" == typeof t.fill && "function" == typeof t.readUInt8
    }
}
, function(t, e) {
    "function" == typeof Object.create ? t.exports = function(t, e) {
        t.super_ = e,
        t.prototype = Object.create(e.prototype, {
            constructor: {
                value: t,
                enumerable: !1,
                writable: !0,
                configurable: !0
            }
        })
    }
    : t.exports = function(t, e) {
        t.super_ = e;
        var r = function() {};
        r.prototype = e.prototype,
        t.prototype = new r,
        t.prototype.constructor = t
    }
}
, function(t, e) {
    t.exports = function() {
        this.cmd = null,
        this.retain = !1,
        this.qos = 0,
        this.dup = !1,
        this.length = -1,
        this.topic = null,
        this.payload = null
    }
}
, function(t, e, r) {
    t.exports = function(t) {
        function e(t) {
            let e = 0;
            for (let i = 0; i < t.length; i++)
                e = (e << 5) - e + t.charCodeAt(i),
                e |= 0;
            return n.colors[Math.abs(e) % n.colors.length]
        }
        function n(t) {
            let r;
            function l(...t) {
                if (!l.enabled)
                    return;
                const e = l
                  , o = Number(new Date)
                  , c = o - (r || o);
                e.diff = c,
                e.prev = r,
                e.curr = o,
                r = o,
                t[0] = n.coerce(t[0]),
                "string" != typeof t[0] && t.unshift("%O");
                let f = 0;
                t[0] = t[0].replace(/%([a-zA-Z%])/g, (r,o)=>{
                    if ("%%" === r)
                        return r;
                    f++;
                    const c = n.formatters[o];
                    if ("function" == typeof c) {
                        const n = t[f];
                        r = c.call(e, n),
                        t.splice(f, 1),
                        f--
                    }
                    return r
                }
                ),
                n.formatArgs.call(e, t),
                (e.log || n.log).apply(e, t)
            }
            return l.namespace = t,
            l.enabled = n.enabled(t),
            l.useColors = n.useColors(),
            l.color = e(t),
            l.destroy = o,
            l.extend = c,
            "function" == typeof n.init && n.init(l),
            n.instances.push(l),
            l
        }
        function o() {
            const t = n.instances.indexOf(this);
            return -1 !== t && (n.instances.splice(t, 1),
            !0)
        }
        function c(t, e) {
            const r = n(this.namespace + (void 0 === e ? ":" : e) + t);
            return r.log = this.log,
            r
        }
        function l(t) {
            return t.toString().substring(2, t.toString().length - 2).replace(/\.\*\?$/, "*")
        }
        return n.debug = n,
        n.default = n,
        n.coerce = function(t) {
            if (t instanceof Error)
                return t.stack || t.message;
            return t
        }
        ,
        n.disable = function() {
            const t = [...n.names.map(l), ...n.skips.map(l).map(t=>"-" + t)].join(",");
            return n.enable(""),
            t
        }
        ,
        n.enable = function(t) {
            let i;
            n.save(t),
            n.names = [],
            n.skips = [];
            const e = ("string" == typeof t ? t : "").split(/[\s,]+/)
              , r = e.length;
            for (i = 0; i < r; i++)
                e[i] && ("-" === (t = e[i].replace(/\*/g, ".*?"))[0] ? n.skips.push(new RegExp("^" + t.substr(1) + "$")) : n.names.push(new RegExp("^" + t + "$")));
            for (i = 0; i < n.instances.length; i++) {
                const t = n.instances[i];
                t.enabled = n.enabled(t.namespace)
            }
        }
        ,
        n.enabled = function(t) {
            if ("*" === t[t.length - 1])
                return !0;
            let i, e;
            for (i = 0,
            e = n.skips.length; i < e; i++)
                if (n.skips[i].test(t))
                    return !1;
            for (i = 0,
            e = n.names.length; i < e; i++)
                if (n.names[i].test(t))
                    return !0;
            return !1
        }
        ,
        n.humanize = r(506),
        Object.keys(t).forEach(e=>{
            n[e] = t[e]
        }
        ),
        n.instances = [],
        n.names = [],
        n.skips = [],
        n.formatters = {},
        n.selectColor = e,
        n.enable(n.load()),
        n
    }
}
, function(t, e) {
    var s = 1e3
      , r = 6e4
      , n = 36e5
      , o = 24 * n;
    function c(t, e, r, n) {
        var o = e >= 1.5 * r;
        return Math.round(t / r) + " " + n + (o ? "s" : "")
    }
    t.exports = function(t, e) {
        e = e || {};
        var l = typeof t;
        if ("string" === l && t.length > 0)
            return function(t) {
                if ((t = String(t)).length > 100)
                    return;
                var e = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);
                if (!e)
                    return;
                var c = parseFloat(e[1]);
                switch ((e[2] || "ms").toLowerCase()) {
                case "years":
                case "year":
                case "yrs":
                case "yr":
                case "y":
                    return 315576e5 * c;
                case "weeks":
                case "week":
                case "w":
                    return 6048e5 * c;
                case "days":
                case "day":
                case "d":
                    return c * o;
                case "hours":
                case "hour":
                case "hrs":
                case "hr":
                case "h":
                    return c * n;
                case "minutes":
                case "minute":
                case "mins":
                case "min":
                case "m":
                    return c * r;
                case "seconds":
                case "second":
                case "secs":
                case "sec":
                case "s":
                    return c * s;
                case "milliseconds":
                case "millisecond":
                case "msecs":
                case "msec":
                case "ms":
                    return c;
                default:
                    return
                }
            }(t);
        if ("number" === l && isFinite(t))
            return e.long ? function(t) {
                var e = Math.abs(t);
                if (e >= o)
                    return c(t, e, o, "day");
                if (e >= n)
                    return c(t, e, n, "hour");
                if (e >= r)
                    return c(t, e, r, "minute");
                if (e >= s)
                    return c(t, e, s, "second");
                return t + " ms"
            }(t) : function(t) {
                var e = Math.abs(t);
                if (e >= o)
                    return Math.round(t / o) + "d";
                if (e >= n)
                    return Math.round(t / n) + "h";
                if (e >= r)
                    return Math.round(t / r) + "m";
                if (e >= s)
                    return Math.round(t / s) + "s";
                return t + "ms"
            }(t);
        throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(t))
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(388).Buffer
      , o = r(429)
      , c = r(394).EventEmitter;
    function l() {
        this._array = new Array(20),
        this._i = 0
    }
    r(384)(l, c),
    l.prototype.write = function(t) {
        return this._array[this._i++] = t,
        !0
    }
    ,
    l.prototype.concat = function() {
        var i, t, e = 0, r = new Array(this._array.length), o = this._array, c = 0;
        for (i = 0; i < o.length && void 0 !== o[i]; i++)
            "string" != typeof o[i] ? r[i] = o[i].length : r[i] = n.byteLength(o[i]),
            e += r[i];
        for (t = n.allocUnsafe(e),
        i = 0; i < o.length && void 0 !== o[i]; i++)
            "string" != typeof o[i] ? (o[i].copy(t, c),
            c += r[i]) : (t.write(o[i], c),
            c += r[i]);
        return t
    }
    ,
    t.exports = function(t, e) {
        var r = new l;
        return o(t, r, e),
        r.concat()
    }
}
, function(t, e, r) {
    "use strict";
    var n = r(388).Buffer
      , o = {};
    function c(i) {
        var t = n.allocUnsafe(2);
        return t.writeUInt8(i >> 8, 0),
        t.writeUInt8(255 & i, 1),
        t
    }
    t.exports = {
        cache: o,
        generateCache: function() {
            for (var i = 0; i < 65536; i++)
                o[i] = c(i)
        },
        generateNumber: c,
        genBufVariableByteInt: function(t) {
            var e = 0
              , r = 0
              , o = function(t) {
                return t >= 0 && t < 128 ? 1 : t >= 128 && t < 16384 ? 2 : t >= 16384 && t < 2097152 ? 3 : t >= 2097152 && t < 268435456 ? 4 : 0
            }(t)
              , c = n.allocUnsafe(o);
            do {
                e = t % 128 | 0,
                (t = t / 128 | 0) > 0 && (e |= 128),
                c.writeUInt8(e, r++)
            } while (t > 0);return {
                data: c,
                length: o
            }
        },
        generate4ByteBuffer: function(t) {
            var e = n.allocUnsafe(4);
            return e.writeUInt32BE(t, 0),
            e
        }
    }
}
, function(t, e, r) {
    "use strict";
    function n(t, e, r) {
        var n = this;
        this._callback = t,
        this._args = r,
        this._interval = setInterval(t, e, this._args),
        this.reschedule = function(t) {
            t || (t = n._interval),
            n._interval && clearInterval(n._interval),
            n._interval = setInterval(n._callback, t, n._args)
        }
        ,
        this.clear = function() {
            n._interval && (clearInterval(n._interval),
            n._interval = void 0)
        }
        ,
        this.destroy = function() {
            n._interval && clearInterval(n._interval),
            n._callback = void 0,
            n._interval = void 0,
            n._args = void 0
        }
    }
    t.exports = function() {
        if ("function" != typeof arguments[0])
            throw new Error("callback needed");
        if ("number" != typeof arguments[1])
            throw new Error("interval needed");
        var t;
        if (arguments.length > 0) {
            t = new Array(arguments.length - 2);
            for (var i = 0; i < t.length; i++)
                t[i] = arguments[i + 2]
        }
        return new n(arguments[0],arguments[1],t)
    }
}
, function(t, e, r) {
    "use strict";
    function n(t) {
        for (var e = t.split("/"), i = 0; i < e.length; i++)
            if ("+" !== e[i]) {
                if ("#" === e[i])
                    return i === e.length - 1;
                if (-1 !== e[i].indexOf("+") || -1 !== e[i].indexOf("#"))
                    return !1
            }
        return !0
    }
    t.exports = {
        validateTopics: function(t) {
            if (0 === t.length)
                return "empty_topic_list";
            for (var i = 0; i < t.length; i++)
                if (!n(t[i]))
                    return t[i];
            return null
        }
    }
}
, function(t, e, r) {
    (function(t, n) {
        var o;
        !function(c) {
            e && e.nodeType,
            t && t.nodeType;
            var l = "object" == typeof n && n;
            l.global !== l && l.window !== l && l.self;
            var f, h = 2147483647, d = /^xn--/, y = /[^\x20-\x7E]/, _ = /[\x2E\u3002\uFF0E\uFF61]/g, m = {
                overflow: "Overflow: input needs wider integers to process",
                "not-basic": "Illegal input >= 0x80 (not a basic code point)",
                "invalid-input": "Invalid input"
            }, v = Math.floor, w = String.fromCharCode;
            function S(t) {
                throw new RangeError(m[t])
            }
            function map(t, e) {
                for (var r = t.length, n = []; r--; )
                    n[r] = e(t[r]);
                return n
            }
            function E(t, e) {
                var r = t.split("@")
                  , n = "";
                return r.length > 1 && (n = r[0] + "@",
                t = r[1]),
                n + map((t = t.replace(_, ".")).split("."), e).join(".")
            }
            function k(t) {
                for (var e, r, output = [], n = 0, o = t.length; n < o; )
                    (e = t.charCodeAt(n++)) >= 55296 && e <= 56319 && n < o ? 56320 == (64512 & (r = t.charCodeAt(n++))) ? output.push(((1023 & e) << 10) + (1023 & r) + 65536) : (output.push(e),
                    n--) : output.push(e);
                return output
            }
            function x(t) {
                return map(t, (function(t) {
                    var output = "";
                    return t > 65535 && (output += w((t -= 65536) >>> 10 & 1023 | 55296),
                    t = 56320 | 1023 & t),
                    output += w(t)
                }
                )).join("")
            }
            function I(t, e) {
                return t + 22 + 75 * (t < 26) - ((0 != e) << 5)
            }
            function O(t, e, r) {
                var n = 0;
                for (t = r ? v(t / 700) : t >> 1,
                t += v(t / e); t > 455; n += 36)
                    t = v(t / 35);
                return v(n + 36 * t / (t + 38))
            }
            function C(input) {
                var t, e, r, n, o, c, l, f, d, y, _, output = [], m = input.length, i = 0, w = 128, E = 72;
                for ((e = input.lastIndexOf("-")) < 0 && (e = 0),
                r = 0; r < e; ++r)
                    input.charCodeAt(r) >= 128 && S("not-basic"),
                    output.push(input.charCodeAt(r));
                for (n = e > 0 ? e + 1 : 0; n < m; ) {
                    for (o = i,
                    c = 1,
                    l = 36; n >= m && S("invalid-input"),
                    ((f = (_ = input.charCodeAt(n++)) - 48 < 10 ? _ - 22 : _ - 65 < 26 ? _ - 65 : _ - 97 < 26 ? _ - 97 : 36) >= 36 || f > v((h - i) / c)) && S("overflow"),
                    i += f * c,
                    !(f < (d = l <= E ? 1 : l >= E + 26 ? 26 : l - E)); l += 36)
                        c > v(h / (y = 36 - d)) && S("overflow"),
                        c *= y;
                    E = O(i - o, t = output.length + 1, 0 == o),
                    v(i / t) > h - w && S("overflow"),
                    w += v(i / t),
                    i %= t,
                    output.splice(i++, 0, w)
                }
                return x(output)
            }
            function A(input) {
                var t, e, r, n, o, c, l, q, f, d, y, _, m, E, x, output = [];
                for (_ = (input = k(input)).length,
                t = 128,
                e = 0,
                o = 72,
                c = 0; c < _; ++c)
                    (y = input[c]) < 128 && output.push(w(y));
                for (r = n = output.length,
                n && output.push("-"); r < _; ) {
                    for (l = h,
                    c = 0; c < _; ++c)
                        (y = input[c]) >= t && y < l && (l = y);
                    for (l - t > v((h - e) / (m = r + 1)) && S("overflow"),
                    e += (l - t) * m,
                    t = l,
                    c = 0; c < _; ++c)
                        if ((y = input[c]) < t && ++e > h && S("overflow"),
                        y == t) {
                            for (q = e,
                            f = 36; !(q < (d = f <= o ? 1 : f >= o + 26 ? 26 : f - o)); f += 36)
                                x = q - d,
                                E = 36 - d,
                                output.push(w(I(d + x % E, 0))),
                                q = v(x / E);
                            output.push(w(I(q, 0))),
                            o = O(e, m, r == n),
                            e = 0,
                            ++r
                        }
                    ++e,
                    ++t
                }
                return output.join("")
            }
            f = {
                version: "1.4.1",
                ucs2: {
                    decode: k,
                    encode: x
                },
                decode: C,
                encode: A,
                toASCII: function(input) {
                    return E(input, (function(t) {
                        return y.test(t) ? "xn--" + A(t) : t
                    }
                    ))
                },
                toUnicode: function(input) {
                    return E(input, (function(t) {
                        return d.test(t) ? C(t.slice(4).toLowerCase()) : t
                    }
                    ))
                }
            },
            void 0 === (o = function() {
                return f
            }
            .call(e, r, e, t)) || (t.exports = o)
        }()
    }
    ).call(this, r(209)(t), r(29))
}
, function(t, e, r) {
    "use strict";
    t.exports = {
        isString: function(t) {
            return "string" == typeof t
        },
        isObject: function(t) {
            return "object" == typeof t && null !== t
        },
        isNull: function(t) {
            return null === t
        },
        isNullOrUndefined: function(t) {
            return null == t
        }
    }
}
, function(t, e, r) {
    "use strict";
    e.decode = e.parse = r(514),
    e.encode = e.stringify = r(515)
}
, function(t, e, r) {
    "use strict";
    function n(t, e) {
        return Object.prototype.hasOwnProperty.call(t, e)
    }
    t.exports = function(t, e, r, c) {
        e = e || "&",
        r = r || "=";
        var l = {};
        if ("string" != typeof t || 0 === t.length)
            return l;
        var f = /\+/g;
        t = t.split(e);
        var h = 1e3;
        c && "number" == typeof c.maxKeys && (h = c.maxKeys);
        var d = t.length;
        h > 0 && d > h && (d = h);
        for (var i = 0; i < d; ++i) {
            var y, _, m, v, w = t[i].replace(f, "%20"), S = w.indexOf(r);
            S >= 0 ? (y = w.substr(0, S),
            _ = w.substr(S + 1)) : (y = w,
            _ = ""),
            m = decodeURIComponent(y),
            v = decodeURIComponent(_),
            n(l, m) ? o(l[m]) ? l[m].push(v) : l[m] = [l[m], v] : l[m] = v
        }
        return l
    }
    ;
    var o = Array.isArray || function(t) {
        return "[object Array]" === Object.prototype.toString.call(t)
    }
}
, function(t, e, r) {
    "use strict";
    var n = function(t) {
        switch (typeof t) {
        case "string":
            return t;
        case "boolean":
            return t ? "true" : "false";
        case "number":
            return isFinite(t) ? t : "";
        default:
            return ""
        }
    };
    t.exports = function(t, e, r, l) {
        return e = e || "&",
        r = r || "=",
        null === t && (t = void 0),
        "object" == typeof t ? map(c(t), (function(c) {
            var l = encodeURIComponent(n(c)) + r;
            return o(t[c]) ? map(t[c], (function(t) {
                return l + encodeURIComponent(n(t))
            }
            )).join(e) : l + encodeURIComponent(n(t[c]))
        }
        )).join(e) : l ? encodeURIComponent(n(l)) + r + encodeURIComponent(n(t)) : ""
    }
    ;
    var o = Array.isArray || function(t) {
        return "[object Array]" === Object.prototype.toString.call(t)
    }
    ;
    function map(t, e) {
        if (t.map)
            return t.map(e);
        for (var r = [], i = 0; i < t.length; i++)
            r.push(e(t[i], i));
        return r
    }
    var c = Object.keys || function(t) {
        var e = [];
        for (var r in t)
            Object.prototype.hasOwnProperty.call(t, r) && e.push(r);
        return e
    }
}
, , , function(t, e, r) {
    (function(e) {
        var n = r(519)
          , o = function() {}
          , c = function(t, r, l) {
            if ("function" == typeof r)
                return c(t, null, r);
            r || (r = {}),
            l = n(l || o);
            var f = t._writableState
              , h = t._readableState
              , d = r.readable || !1 !== r.readable && t.readable
              , y = r.writable || !1 !== r.writable && t.writable
              , _ = !1
              , m = function() {
                t.writable || v()
            }
              , v = function() {
                y = !1,
                d || l.call(t)
            }
              , w = function() {
                d = !1,
                y || l.call(t)
            }
              , S = function(e) {
                l.call(t, e ? new Error("exited with error code: " + e) : null)
            }
              , E = function(e) {
                l.call(t, e)
            }
              , k = function() {
                e.nextTick(x)
            }
              , x = function() {
                if (!_)
                    return (!d || h && h.ended && !h.destroyed) && (!y || f && f.ended && !f.destroyed) ? void 0 : l.call(t, new Error("premature close"))
            }
              , I = function() {
                t.req.on("finish", v)
            };
            return !function(t) {
                return t.setHeader && "function" == typeof t.abort
            }(t) ? y && !f && (t.on("end", m),
            t.on("close", m)) : (t.on("complete", v),
            t.on("abort", k),
            t.req ? I() : t.on("request", I)),
            function(t) {
                return t.stdio && Array.isArray(t.stdio) && 3 === t.stdio.length
            }(t) && t.on("exit", S),
            t.on("end", w),
            t.on("finish", v),
            !1 !== r.error && t.on("error", E),
            t.on("close", k),
            function() {
                _ = !0,
                t.removeListener("complete", v),
                t.removeListener("abort", k),
                t.removeListener("request", I),
                t.req && t.req.removeListener("finish", v),
                t.removeListener("end", m),
                t.removeListener("close", m),
                t.removeListener("finish", v),
                t.removeListener("exit", S),
                t.removeListener("end", w),
                t.removeListener("error", E),
                t.removeListener("close", k)
            }
        };
        t.exports = c
    }
    ).call(this, r(147))
}
, function(t, e, r) {
    var n = r(520);
    function o(t) {
        var e = function() {
            return e.called ? e.value : (e.called = !0,
            e.value = t.apply(this, arguments))
        };
        return e.called = !1,
        e
    }
    function c(t) {
        var e = function() {
            if (e.called)
                throw new Error(e.onceError);
            return e.called = !0,
            e.value = t.apply(this, arguments)
        }
          , r = t.name || "Function wrapped with `once`";
        return e.onceError = r + " shouldn't be called more than once",
        e.called = !1,
        e
    }
    t.exports = n(o),
    t.exports.strict = n(c),
    o.proto = o((function() {
        Object.defineProperty(Function.prototype, "once", {
            value: function() {
                return o(this)
            },
            configurable: !0
        }),
        Object.defineProperty(Function.prototype, "onceStrict", {
            value: function() {
                return c(this)
            },
            configurable: !0
        })
    }
    ))
}
, function(t, e) {
    t.exports = function t(e, r) {
        if (e && r)
            return t(e)(r);
        if ("function" != typeof e)
            throw new TypeError("need wrapper function");
        return Object.keys(e).forEach((function(t) {
            n[t] = e[t]
        }
        )),
        n;
        function n() {
            for (var t = new Array(arguments.length), i = 0; i < t.length; i++)
                t[i] = arguments[i];
            var r = e.apply(this, t)
              , n = t[t.length - 1];
            return "function" == typeof r && r !== n && Object.keys(n).forEach((function(t) {
                r[t] = n[t]
            }
            )),
            r
        }
    }
}
, function(t, e) {
    t.exports = function(t) {
        var e = t._readableState;
        return e ? e.objectMode || "number" == typeof t._duplexState ? t.read() : t.read(function(t) {
            if (t.buffer.length)
                return t.buffer.head ? t.buffer.head.data.length : t.buffer[0].length;
            return t.length
        }(e)) : null
    }
}
, function(t, e, r) {
    "use strict";
    (function(e, n) {
        var o = r(390).Transform
          , c = r(407)
          , l = r(523)
          , f = r(388).Buffer;
        t.exports = function(t, r, h) {
            var d, y, _ = "browser" === e.title, m = !!n.WebSocket, v = _ ? function t(e, r, n) {
                if (y.bufferedAmount > S)
                    return void setTimeout(t, E, e, r, n);
                x && "string" == typeof e && (e = f.from(e, "utf8"));
                try {
                    y.send(e)
                } catch (t) {
                    return n(t)
                }
                n()
            }
            : function(t, e, r) {
                if (y.readyState !== y.OPEN)
                    return void r();
                x && "string" == typeof t && (t = f.from(t, "utf8"));
                y.send(t, r)
            }
            ;
            r && !Array.isArray(r) && "object" == typeof r && (h = r,
            r = null,
            ("string" == typeof h.protocol || Array.isArray(h.protocol)) && (r = h.protocol));
            h || (h = {});
            void 0 === h.objectMode && (h.objectMode = !(!0 === h.binary || void 0 === h.binary));
            var w = function(t, e, r) {
                var n = new o({
                    objectMode: t.objectMode
                });
                return n._write = e,
                n._flush = r,
                n
            }(h, v, (function(t) {
                y.close(),
                t()
            }
            ));
            h.objectMode || (w._writev = P);
            var S = h.browserBufferSize || 524288
              , E = h.browserBufferTimeout || 1e3;
            "object" == typeof t ? y = t : (y = m && _ ? new l(t,r) : new l(t,r,h)).binaryType = "arraybuffer";
            var k = void 0 === y.addEventListener;
            y.readyState === y.OPEN ? d = w : (d = d = c(void 0, void 0, h),
            h.objectMode || (d._writev = P),
            k ? y.addEventListener("open", I) : y.onopen = I);
            d.socket = y,
            k ? (y.addEventListener("close", O),
            y.addEventListener("error", C),
            y.addEventListener("message", A)) : (y.onclose = O,
            y.onerror = C,
            y.onmessage = A);
            w.on("close", (function() {
                y.close()
            }
            ));
            var x = !h.objectMode;
            function I() {
                d.setReadable(w),
                d.setWritable(w),
                d.emit("connect")
            }
            function O() {
                d.end(),
                d.destroy()
            }
            function C(t) {
                d.destroy(t)
            }
            function A(t) {
                var data = t.data;
                data = data instanceof ArrayBuffer ? f.from(data) : f.from(data, "utf8"),
                w.push(data)
            }
            function P(t, e) {
                for (var r = new Array(t.length), i = 0; i < t.length; i++)
                    "string" == typeof t[i].chunk ? r[i] = f.from(t[i], "utf8") : r[i] = t[i].chunk;
                this._write(f.concat(r), "binary", e)
            }
            return d
        }
    }
    ).call(this, r(147), r(29))
}
, function(t, e) {
    var r = null;
    "undefined" != typeof WebSocket ? r = WebSocket : "undefined" != typeof MozWebSocket ? r = MozWebSocket : "undefined" != typeof window && (r = window.WebSocket || window.MozWebSocket),
    t.exports = r
}
, , function(t, e, r) {
    "use strict";
    (function(e) {
        var n = r(435)
          , o = r(408)
          , c = r(430)
          , l = r(401)
          , f = {};
        function h(t, e) {
            if ("object" != typeof t || e || (e = t,
            t = null),
            e = e || {},
            t) {
                var r = c.parse(t, !0);
                if (null != r.port && (r.port = Number(r.port)),
                null === (e = l(r, e)).protocol)
                    throw new Error("Missing protocol");
                e.protocol = e.protocol.replace(/:$/, "")
            }
            if (function(t) {
                var e;
                t.auth && ((e = t.auth.match(/^(.+):(.+)$/)) ? (t.username = e[1],
                t.password = e[2]) : t.username = t.auth)
            }(e),
            e.query && "string" == typeof e.query.clientId && (e.clientId = e.query.clientId),
            e.cert && e.key) {
                if (!e.protocol)
                    throw new Error("Missing secure protocol key");
                if (-1 === ["mqtts", "wss", "wxs", "alis"].indexOf(e.protocol))
                    switch (e.protocol) {
                    case "mqtt":
                        e.protocol = "mqtts";
                        break;
                    case "ws":
                        e.protocol = "wss";
                        break;
                    case "wx":
                        e.protocol = "wxs";
                        break;
                    case "ali":
                        e.protocol = "alis";
                        break;
                    default:
                        throw new Error('Unknown protocol for secure connection: "' + e.protocol + '"!')
                    }
            }
            if (!f[e.protocol]) {
                var o = -1 !== ["mqtts", "wss"].indexOf(e.protocol);
                e.protocol = ["mqtt", "mqtts", "ws", "wss", "wx", "wxs", "ali", "alis"].filter((function(t, e) {
                    return (!o || e % 2 != 0) && "function" == typeof f[t]
                }
                ))[0]
            }
            if (!1 === e.clean && !e.clientId)
                throw new Error("Missing clientId for unclean clients");
            return e.protocol && (e.defaultProtocol = e.protocol),
            new n((function(t) {
                return e.servers && (t._reconnectCount && t._reconnectCount !== e.servers.length || (t._reconnectCount = 0),
                e.host = e.servers[t._reconnectCount].host,
                e.port = e.servers[t._reconnectCount].port,
                e.protocol = e.servers[t._reconnectCount].protocol ? e.servers[t._reconnectCount].protocol : e.defaultProtocol,
                e.hostname = e.host,
                t._reconnectCount++),
                f[e.protocol](t, e)
            }
            ),e)
        }
        "browser" !== e.title ? (f.mqtt = r(431),
        f.tcp = r(431),
        f.ssl = r(406),
        f.tls = r(406),
        f.mqtts = r(406)) : (f.wx = r(432),
        f.wxs = r(432),
        f.ali = r(433),
        f.alis = r(433)),
        f.ws = r(434),
        f.wss = r(434),
        t.exports = h,
        t.exports.connect = h,
        t.exports.MqttClient = n,
        t.exports.Store = o
    }
    ).call(this, r(147))
}
])]);
